{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Examples from the SICM book"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The chapters and subsections correspond to the second edition of SICM. The plots are not optimal yet, for improvement I need to dive more into `thi.ng` or, when eventually available, `plot.ly`. Comments please to https://github.com/kloimhardt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "#'book-examples/tex"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(require '[clojupyter.misc.helper :as helper])\n",
    "(run! helper/add-dependencies '[[net.littleredcomputer/sicmutils \"0.12.0-SNAPSHOT\"]\n",
    "                                [thi.ng/geom \"0.0.908\"]])\n",
    "(ns book-examples\n",
    "    (:refer-clojure :exclude [partial zero? + - * / ref])\n",
    "    (:require [sicmutils.env :refer :all]\n",
    "              [sicmutils.mechanics.lagrange :as lg]\n",
    "              [sicmutils.numerical.minimize :as mn]\n",
    "              [clojupyter.misc.display :as display]\n",
    "              [thi.ng.geom.viz.core :as viz]\n",
    "              [thi.ng.geom.svg.core :as svg]))\n",
    "(defn tex [x] (-> x tex$$ display/latex))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.4 Computing Actions"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Calculate the action for the free particle along a path. Consider the particle moving at uniform speed along a straight line."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "435.0"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(defn test-path\n",
    "  \"See p. 20\"\n",
    "  [t]\n",
    "  (up (+ (* 4 t) 7)\n",
    "      (+ (* 3 t) 5)\n",
    "      (+ (* 2 t) 1)))\n",
    "\n",
    "(Lagrangian-action (lg/L-free-particle 3.0) test-path 0.0 10.0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Paths of minimum Action"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Show that the action is smaller along a straight-line test path than along nearby paths"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "564.1214285996772"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(defn make-η\n",
    "  \"See p. 21\"\n",
    "  [ν t1 t2]\n",
    "  (fn [t]\n",
    "    (* (- t t1) (- t t2) (ν t))))\n",
    "\n",
    "(defn varied-free-particle-action\n",
    "  \"See p. 21\"\n",
    "  [mass q ν t1 t2]\n",
    "  (fn [ε]\n",
    "    (let [η (make-η ν t1 t2)]\n",
    "      (Lagrangian-action (lg/L-free-particle mass)\n",
    "                         (+ q (* ε η)) t1 t2))))\n",
    "             \n",
    "((varied-free-particle-action 3.0 test-path (up sin cos square) 0.0 10.0) 0.01)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Simulate lots of the paths in this manner. Proof that the minimum value of the action is the action along the straight path. For this proof it suffices that some optimization parameter is close to zero (need not be exactly zero)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[-9.163058228844889E-10 435.0000000594215 6]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(minimize (varied-free-particle-action 3.0 test-path (up sin cos square) 0.0 10.0) -2 1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "I provide some helper functions for visualization:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "(defn points->plot [paths idx1 idx2]\n",
    "    (letfn [(f1 [v i j] [(nth v i) (nth v j)])\n",
    "            (f2 [v i j] (mapv #(f1 % i j) v))\n",
    "            (f3 [p i j] (mapv #(f2 (second %) i j) p))\n",
    "            (f4 [points stroke]\n",
    "                {:values  points\n",
    "                 :attribs {:stroke stroke :stroke-width \"2pt\"}\n",
    "                 :layout  viz/svg-scatter-plot})\n",
    "            (f6 [p] (mapv first p))\n",
    "            (f7 [p i j] (mapv #(vector %1 %2) (f3 p i j) (f6 p)))\n",
    "            (f8 [p i j] (mapv #(apply f4 %) (f7 p i j)))\n",
    "            (f10 [p i] (flatten (f3 p i i)))\n",
    "            (f11 [p i] (let [d (f10 p i)] [(apply min d) (apply max d)]))]\n",
    "        \n",
    "    {:x-axis (viz/linear-axis\n",
    "              {:domain (f11 paths idx1)\n",
    "               :range  [50 (- 985 10)]\n",
    "               :major 1\n",
    "               :pos    550})\n",
    "     :y-axis (viz/linear-axis\n",
    "              {:domain      (f11 paths idx2)\n",
    "               :range       [550 20]\n",
    "               :major       1\n",
    "               :minor       0.2\n",
    "               :pos         50\n",
    "               :label-dist  15\n",
    "               :label-style {:text-anchor \"end\"}})\n",
    "     :grid   {:attribs {:stroke \"#caa\"}\n",
    "              :minor-x true\n",
    "              :minor-y false}\n",
    "     :data (f8 paths idx1 idx2)}))\n",
    "\n",
    "(defn points-xy->plot [paths] \n",
    "  (points->plot paths 1 2))\n",
    "\n",
    "(defn points-xz->plot [paths] \n",
    "  (points->plot paths 1 3))\n",
    "\n",
    "(defn points-tz->plot [paths] \n",
    "  (points->plot paths 0 3))\n",
    "\n",
    "(defn export-viz\n",
    "  [spec]\n",
    "  (->> spec\n",
    "       (viz/svg-plot2d-cartesian)\n",
    "       (svg/svg {:width 985 :height 600})\n",
    "       (svg/serialize)))\n",
    "\n",
    "(defn alt-range [t0 t1 nofsteps]\n",
    "  (map float\n",
    "   (-> (linear-interpolants t0 t1 nofsteps)\n",
    "     (conj t0)\n",
    "     vec\n",
    "     (conj t1))))\n",
    "\n",
    "(defn make-path-txyz [fn_t t0 t1 nofsteps]\n",
    "  (mapv #(cons % (vec (rest (simplify (fn_t %)))))\n",
    "    (alt-range t0 t1 nofsteps)))\n",
    "\n",
    "(def blue \"#0af\")\n",
    "(def orange \"#f60\")\n",
    "(def red \"#f00\")\n",
    "\n",
    "(comment \n",
    " (def werte {blue [[0 7 5 1] [1 11 8 10]]\n",
    "            orange [[2 9 2 4] [3 3  9 7]]})\n",
    "\n",
    " (-> (points-xy->plot werte)\n",
    "    export-viz\n",
    "    display/make-html))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Create data to plot two straight paths in the xy plane. One path is along the x axis (name: path-along-x), the second path leads in all directions."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "#'book-examples/path-points-1"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(defn path-along-x\n",
    "  [t]\n",
    "  (up (+ (* 5 t) 1)\n",
    "      (* 0 t)\n",
    "      (* 0 t)))\n",
    "\n",
    "(def path-points-1 {blue (make-path-txyz path-along-x 0 10 50)\n",
    "                    orange (make-path-txyz test-path 0 10 50)})"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Plot the two paths"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<?xml version=\"1.0\"?>\n",
       "<svg height=\"600\" version=\"1.1\" width=\"985\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\"><g><g stroke-dasharray=\"1 1\" stroke=\"#caa\"><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"68.50\" x2=\"68.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"87.00\" x2=\"87.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"105.50\" x2=\"105.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"124.00\" x2=\"124.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"142.50\" x2=\"142.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"161.00\" x2=\"161.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"179.50\" x2=\"179.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"198.00\" x2=\"198.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"216.50\" x2=\"216.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"235.00\" x2=\"235.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"253.50\" x2=\"253.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"272.00\" x2=\"272.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"290.50\" x2=\"290.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"309.00\" x2=\"309.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"327.50\" x2=\"327.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"346.00\" x2=\"346.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"364.50\" x2=\"364.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"383.00\" x2=\"383.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"401.50\" x2=\"401.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"420.00\" x2=\"420.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"438.50\" x2=\"438.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"457.00\" x2=\"457.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"475.50\" x2=\"475.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"494.00\" x2=\"494.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"512.50\" x2=\"512.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"531.00\" x2=\"531.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"549.50\" x2=\"549.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"568.00\" x2=\"568.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"586.50\" x2=\"586.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"605.00\" x2=\"605.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"623.50\" x2=\"623.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"642.00\" x2=\"642.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"660.50\" x2=\"660.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"679.00\" x2=\"679.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"697.50\" x2=\"697.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"716.00\" x2=\"716.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"734.50\" x2=\"734.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"753.00\" x2=\"753.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"771.50\" x2=\"771.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"790.00\" x2=\"790.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"808.50\" x2=\"808.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"827.00\" x2=\"827.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"845.50\" x2=\"845.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"864.00\" x2=\"864.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"882.50\" x2=\"882.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"901.00\" x2=\"901.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"919.50\" x2=\"919.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"938.00\" x2=\"938.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"956.50\" x2=\"956.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"975.00\" x2=\"975.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"550.00\" y2=\"550.00\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"534.86\" y2=\"534.86\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"519.71\" y2=\"519.71\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"504.57\" y2=\"504.57\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"489.43\" y2=\"489.43\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"474.29\" y2=\"474.29\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"459.14\" y2=\"459.14\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"444.00\" y2=\"444.00\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"428.86\" y2=\"428.86\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"413.71\" y2=\"413.71\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"398.57\" y2=\"398.57\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"383.43\" y2=\"383.43\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"368.29\" y2=\"368.29\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"353.14\" y2=\"353.14\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"338.00\" y2=\"338.00\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"322.86\" y2=\"322.86\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"307.71\" y2=\"307.71\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"292.57\" y2=\"292.57\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"277.43\" y2=\"277.43\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"262.29\" y2=\"262.29\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"247.14\" y2=\"247.14\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"232.00\" y2=\"232.00\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"216.86\" y2=\"216.86\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"201.71\" y2=\"201.71\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"186.57\" y2=\"186.57\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"171.43\" y2=\"171.43\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"156.29\" y2=\"156.29\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"141.14\" y2=\"141.14\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"126.00\" y2=\"126.00\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"110.86\" y2=\"110.86\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"95.71\" y2=\"95.71\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"80.57\" y2=\"80.57\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"65.43\" y2=\"65.43\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"50.29\" y2=\"50.29\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"35.14\" y2=\"35.14\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"20.00\" y2=\"20.00\" /></g><g stroke-width=\"2pt\" stroke=\"#0af\"><circle cx=\"50.00\" cy=\"550.00\" r=\"3\" /><circle cx=\"68.14\" cy=\"550.00\" r=\"3\" /><circle cx=\"86.27\" cy=\"550.00\" r=\"3\" /><circle cx=\"104.41\" cy=\"550.00\" r=\"3\" /><circle cx=\"122.55\" cy=\"550.00\" r=\"3\" /><circle cx=\"140.69\" cy=\"550.00\" r=\"3\" /><circle cx=\"158.82\" cy=\"550.00\" r=\"3\" /><circle cx=\"176.96\" cy=\"550.00\" r=\"3\" /><circle cx=\"195.10\" cy=\"550.00\" r=\"3\" /><circle cx=\"213.24\" cy=\"550.00\" r=\"3\" /><circle cx=\"231.37\" cy=\"550.00\" r=\"3\" /><circle cx=\"249.51\" cy=\"550.00\" r=\"3\" /><circle cx=\"267.65\" cy=\"550.00\" r=\"3\" /><circle cx=\"285.78\" cy=\"550.00\" r=\"3\" /><circle cx=\"303.92\" cy=\"550.00\" r=\"3\" /><circle cx=\"322.06\" cy=\"550.00\" r=\"3\" /><circle cx=\"340.20\" cy=\"550.00\" r=\"3\" /><circle cx=\"358.33\" cy=\"550.00\" r=\"3\" /><circle cx=\"376.47\" cy=\"550.00\" r=\"3\" /><circle cx=\"394.61\" cy=\"550.00\" r=\"3\" /><circle cx=\"412.75\" cy=\"550.00\" r=\"3\" /><circle cx=\"430.88\" cy=\"550.00\" r=\"3\" /><circle cx=\"449.02\" cy=\"550.00\" r=\"3\" /><circle cx=\"467.16\" cy=\"550.00\" r=\"3\" /><circle cx=\"485.29\" cy=\"550.00\" r=\"3\" /><circle cx=\"503.43\" cy=\"550.00\" r=\"3\" /><circle cx=\"521.57\" cy=\"550.00\" r=\"3\" /><circle cx=\"539.71\" cy=\"550.00\" r=\"3\" /><circle cx=\"557.84\" cy=\"550.00\" r=\"3\" /><circle cx=\"575.98\" cy=\"550.00\" r=\"3\" /><circle cx=\"594.12\" cy=\"550.00\" r=\"3\" /><circle cx=\"612.25\" cy=\"550.00\" r=\"3\" /><circle cx=\"630.39\" cy=\"550.00\" r=\"3\" /><circle cx=\"648.53\" cy=\"550.00\" r=\"3\" /><circle cx=\"666.67\" cy=\"550.00\" r=\"3\" /><circle cx=\"684.80\" cy=\"550.00\" r=\"3\" /><circle cx=\"702.94\" cy=\"550.00\" r=\"3\" /><circle cx=\"721.08\" cy=\"550.00\" r=\"3\" /><circle cx=\"739.22\" cy=\"550.00\" r=\"3\" /><circle cx=\"757.35\" cy=\"550.00\" r=\"3\" /><circle cx=\"775.49\" cy=\"550.00\" r=\"3\" /><circle cx=\"793.63\" cy=\"550.00\" r=\"3\" /><circle cx=\"811.76\" cy=\"550.00\" r=\"3\" /><circle cx=\"829.90\" cy=\"550.00\" r=\"3\" /><circle cx=\"848.04\" cy=\"550.00\" r=\"3\" /><circle cx=\"866.18\" cy=\"550.00\" r=\"3\" /><circle cx=\"884.31\" cy=\"550.00\" r=\"3\" /><circle cx=\"902.45\" cy=\"550.00\" r=\"3\" /><circle cx=\"920.59\" cy=\"550.00\" r=\"3\" /><circle cx=\"938.73\" cy=\"550.00\" r=\"3\" /><circle cx=\"956.86\" cy=\"550.00\" r=\"3\" /><circle cx=\"975.00\" cy=\"550.00\" r=\"3\" /></g><g stroke-width=\"2pt\" stroke=\"#f60\"><circle cx=\"161.00\" cy=\"474.29\" r=\"3\" /><circle cx=\"175.51\" cy=\"465.38\" r=\"3\" /><circle cx=\"190.02\" cy=\"456.47\" r=\"3\" /><circle cx=\"204.53\" cy=\"447.56\" r=\"3\" /><circle cx=\"219.04\" cy=\"438.66\" r=\"3\" /><circle cx=\"233.55\" cy=\"429.75\" r=\"3\" /><circle cx=\"248.06\" cy=\"420.84\" r=\"3\" /><circle cx=\"262.57\" cy=\"411.93\" r=\"3\" /><circle cx=\"277.08\" cy=\"403.03\" r=\"3\" /><circle cx=\"291.59\" cy=\"394.12\" r=\"3\" /><circle cx=\"306.10\" cy=\"385.21\" r=\"3\" /><circle cx=\"320.61\" cy=\"376.30\" r=\"3\" /><circle cx=\"335.12\" cy=\"367.39\" r=\"3\" /><circle cx=\"349.63\" cy=\"358.49\" r=\"3\" /><circle cx=\"364.14\" cy=\"349.58\" r=\"3\" /><circle cx=\"378.65\" cy=\"340.67\" r=\"3\" /><circle cx=\"393.16\" cy=\"331.76\" r=\"3\" /><circle cx=\"407.67\" cy=\"322.86\" r=\"3\" /><circle cx=\"422.18\" cy=\"313.95\" r=\"3\" /><circle cx=\"436.69\" cy=\"305.04\" r=\"3\" /><circle cx=\"451.20\" cy=\"296.13\" r=\"3\" /><circle cx=\"465.71\" cy=\"287.23\" r=\"3\" /><circle cx=\"480.22\" cy=\"278.32\" r=\"3\" /><circle cx=\"494.73\" cy=\"269.41\" r=\"3\" /><circle cx=\"509.24\" cy=\"260.50\" r=\"3\" /><circle cx=\"523.75\" cy=\"251.60\" r=\"3\" /><circle cx=\"538.25\" cy=\"242.69\" r=\"3\" /><circle cx=\"552.76\" cy=\"233.78\" r=\"3\" /><circle cx=\"567.27\" cy=\"224.87\" r=\"3\" /><circle cx=\"581.78\" cy=\"215.97\" r=\"3\" /><circle cx=\"596.29\" cy=\"207.06\" r=\"3\" /><circle cx=\"610.80\" cy=\"198.15\" r=\"3\" /><circle cx=\"625.31\" cy=\"189.24\" r=\"3\" /><circle cx=\"639.82\" cy=\"180.34\" r=\"3\" /><circle cx=\"654.33\" cy=\"171.43\" r=\"3\" /><circle cx=\"668.84\" cy=\"162.52\" r=\"3\" /><circle cx=\"683.35\" cy=\"153.61\" r=\"3\" /><circle cx=\"697.86\" cy=\"144.71\" r=\"3\" /><circle cx=\"712.37\" cy=\"135.80\" r=\"3\" /><circle cx=\"726.88\" cy=\"126.89\" r=\"3\" /><circle cx=\"741.39\" cy=\"117.98\" r=\"3\" /><circle cx=\"755.90\" cy=\"109.08\" r=\"3\" /><circle cx=\"770.41\" cy=\"100.17\" r=\"3\" /><circle cx=\"784.92\" cy=\"91.26\" r=\"3\" /><circle cx=\"799.43\" cy=\"82.35\" r=\"3\" /><circle cx=\"813.94\" cy=\"73.45\" r=\"3\" /><circle cx=\"828.45\" cy=\"64.54\" r=\"3\" /><circle cx=\"842.96\" cy=\"55.63\" r=\"3\" /><circle cx=\"857.47\" cy=\"46.72\" r=\"3\" /><circle cx=\"871.98\" cy=\"37.82\" r=\"3\" /><circle cx=\"886.49\" cy=\"28.91\" r=\"3\" /><circle cx=\"901.00\" cy=\"20.00\" r=\"3\" /></g><g stroke=\"black\"><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"68.50\" x2=\"68.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"87.00\" x2=\"87.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"105.50\" x2=\"105.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"124.00\" x2=\"124.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"142.50\" x2=\"142.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"161.00\" x2=\"161.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"179.50\" x2=\"179.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"198.00\" x2=\"198.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"216.50\" x2=\"216.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"235.00\" x2=\"235.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"253.50\" x2=\"253.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"272.00\" x2=\"272.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"290.50\" x2=\"290.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"309.00\" x2=\"309.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"327.50\" x2=\"327.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"346.00\" x2=\"346.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"364.50\" x2=\"364.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"383.00\" x2=\"383.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"401.50\" x2=\"401.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"420.00\" x2=\"420.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"438.50\" x2=\"438.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"457.00\" x2=\"457.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"475.50\" x2=\"475.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"494.00\" x2=\"494.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"512.50\" x2=\"512.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"531.00\" x2=\"531.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"549.50\" x2=\"549.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"568.00\" x2=\"568.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"586.50\" x2=\"586.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"605.00\" x2=\"605.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"623.50\" x2=\"623.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"642.00\" x2=\"642.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"660.50\" x2=\"660.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"679.00\" x2=\"679.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"697.50\" x2=\"697.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"716.00\" x2=\"716.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"734.50\" x2=\"734.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"753.00\" x2=\"753.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"771.50\" x2=\"771.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"790.00\" x2=\"790.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"808.50\" x2=\"808.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"827.00\" x2=\"827.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"845.50\" x2=\"845.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"864.00\" x2=\"864.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"882.50\" x2=\"882.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"901.00\" x2=\"901.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"919.50\" x2=\"919.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"938.00\" x2=\"938.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"956.50\" x2=\"956.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"975.00\" x2=\"975.00\" y1=\"550.00\" y2=\"560.00\" /><g fill=\"black\" font-family=\"Arial, sans-serif\" font-size=\"10\" stroke=\"none\" text-anchor=\"middle\"><text x=\"50.00\" y=\"570.00\">1.00</text><text x=\"68.50\" y=\"570.00\">2.00</text><text x=\"87.00\" y=\"570.00\">3.00</text><text x=\"105.50\" y=\"570.00\">4.00</text><text x=\"124.00\" y=\"570.00\">5.00</text><text x=\"142.50\" y=\"570.00\">6.00</text><text x=\"161.00\" y=\"570.00\">7.00</text><text x=\"179.50\" y=\"570.00\">8.00</text><text x=\"198.00\" y=\"570.00\">9.00</text><text x=\"216.50\" y=\"570.00\">10.00</text><text x=\"235.00\" y=\"570.00\">11.00</text><text x=\"253.50\" y=\"570.00\">12.00</text><text x=\"272.00\" y=\"570.00\">13.00</text><text x=\"290.50\" y=\"570.00\">14.00</text><text x=\"309.00\" y=\"570.00\">15.00</text><text x=\"327.50\" y=\"570.00\">16.00</text><text x=\"346.00\" y=\"570.00\">17.00</text><text x=\"364.50\" y=\"570.00\">18.00</text><text x=\"383.00\" y=\"570.00\">19.00</text><text x=\"401.50\" y=\"570.00\">20.00</text><text x=\"420.00\" y=\"570.00\">21.00</text><text x=\"438.50\" y=\"570.00\">22.00</text><text x=\"457.00\" y=\"570.00\">23.00</text><text x=\"475.50\" y=\"570.00\">24.00</text><text x=\"494.00\" y=\"570.00\">25.00</text><text x=\"512.50\" y=\"570.00\">26.00</text><text x=\"531.00\" y=\"570.00\">27.00</text><text x=\"549.50\" y=\"570.00\">28.00</text><text x=\"568.00\" y=\"570.00\">29.00</text><text x=\"586.50\" y=\"570.00\">30.00</text><text x=\"605.00\" y=\"570.00\">31.00</text><text x=\"623.50\" y=\"570.00\">32.00</text><text x=\"642.00\" y=\"570.00\">33.00</text><text x=\"660.50\" y=\"570.00\">34.00</text><text x=\"679.00\" y=\"570.00\">35.00</text><text x=\"697.50\" y=\"570.00\">36.00</text><text x=\"716.00\" y=\"570.00\">37.00</text><text x=\"734.50\" y=\"570.00\">38.00</text><text x=\"753.00\" y=\"570.00\">39.00</text><text x=\"771.50\" y=\"570.00\">40.00</text><text x=\"790.00\" y=\"570.00\">41.00</text><text x=\"808.50\" y=\"570.00\">42.00</text><text x=\"827.00\" y=\"570.00\">43.00</text><text x=\"845.50\" y=\"570.00\">44.00</text><text x=\"864.00\" y=\"570.00\">45.00</text><text x=\"882.50\" y=\"570.00\">46.00</text><text x=\"901.00\" y=\"570.00\">47.00</text><text x=\"919.50\" y=\"570.00\">48.00</text><text x=\"938.00\" y=\"570.00\">49.00</text><text x=\"956.50\" y=\"570.00\">50.00</text><text x=\"975.00\" y=\"570.00\">51.00</text></g><line x1=\"50.00\" x2=\"975.00\" y1=\"550.00\" y2=\"550.00\" /></g><g stroke=\"black\"><line x1=\"50.00\" x2=\"40.00\" y1=\"550.00\" y2=\"550.00\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"534.86\" y2=\"534.86\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"519.71\" y2=\"519.71\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"504.57\" y2=\"504.57\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"489.43\" y2=\"489.43\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"474.29\" y2=\"474.29\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"459.14\" y2=\"459.14\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"444.00\" y2=\"444.00\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"428.86\" y2=\"428.86\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"413.71\" y2=\"413.71\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"398.57\" y2=\"398.57\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"383.43\" y2=\"383.43\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"368.29\" y2=\"368.29\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"353.14\" y2=\"353.14\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"338.00\" y2=\"338.00\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"322.86\" y2=\"322.86\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"307.71\" y2=\"307.71\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"292.57\" y2=\"292.57\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"277.43\" y2=\"277.43\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"262.29\" y2=\"262.29\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"247.14\" y2=\"247.14\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"232.00\" y2=\"232.00\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"216.86\" y2=\"216.86\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"201.71\" y2=\"201.71\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"186.57\" y2=\"186.57\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"171.43\" y2=\"171.43\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"156.29\" y2=\"156.29\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"141.14\" y2=\"141.14\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"126.00\" y2=\"126.00\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"110.86\" y2=\"110.86\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"95.71\" y2=\"95.71\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"80.57\" y2=\"80.57\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"65.43\" y2=\"65.43\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"50.29\" y2=\"50.29\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"35.14\" y2=\"35.14\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"20.00\" y2=\"20.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"550.00\" y2=\"550.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"546.97\" y2=\"546.97\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"543.94\" y2=\"543.94\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"540.91\" y2=\"540.91\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"537.89\" y2=\"537.89\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"534.86\" y2=\"534.86\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"531.83\" y2=\"531.83\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"528.80\" y2=\"528.80\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"525.77\" y2=\"525.77\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"522.74\" y2=\"522.74\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"519.71\" y2=\"519.71\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"516.69\" y2=\"516.69\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"513.66\" y2=\"513.66\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"510.63\" y2=\"510.63\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"507.60\" y2=\"507.60\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"504.57\" y2=\"504.57\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"501.54\" y2=\"501.54\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"498.51\" y2=\"498.51\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"495.49\" y2=\"495.49\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"492.46\" y2=\"492.46\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"489.43\" y2=\"489.43\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"486.40\" y2=\"486.40\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"483.37\" y2=\"483.37\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"480.34\" y2=\"480.34\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"477.31\" y2=\"477.31\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"474.29\" y2=\"474.29\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"471.26\" y2=\"471.26\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"468.23\" y2=\"468.23\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"465.20\" y2=\"465.20\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"462.17\" y2=\"462.17\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"459.14\" y2=\"459.14\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"456.11\" y2=\"456.11\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"453.09\" y2=\"453.09\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"450.06\" y2=\"450.06\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"447.03\" y2=\"447.03\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"444.00\" y2=\"444.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"440.97\" y2=\"440.97\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"437.94\" y2=\"437.94\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"434.91\" y2=\"434.91\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"431.89\" y2=\"431.89\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"428.86\" y2=\"428.86\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"425.83\" y2=\"425.83\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"422.80\" y2=\"422.80\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"419.77\" y2=\"419.77\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"416.74\" y2=\"416.74\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"413.71\" y2=\"413.71\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"410.69\" y2=\"410.69\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"407.66\" y2=\"407.66\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"404.63\" y2=\"404.63\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"401.60\" y2=\"401.60\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"398.57\" y2=\"398.57\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"395.54\" y2=\"395.54\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"392.51\" y2=\"392.51\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"389.49\" y2=\"389.49\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"386.46\" y2=\"386.46\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"383.43\" y2=\"383.43\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"380.40\" y2=\"380.40\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"377.37\" y2=\"377.37\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"374.34\" y2=\"374.34\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"371.31\" y2=\"371.31\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"368.29\" y2=\"368.29\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"365.26\" y2=\"365.26\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"362.23\" y2=\"362.23\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"359.20\" y2=\"359.20\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"356.17\" y2=\"356.17\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"353.14\" y2=\"353.14\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"350.11\" y2=\"350.11\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"347.09\" y2=\"347.09\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"344.06\" y2=\"344.06\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"341.03\" y2=\"341.03\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"338.00\" y2=\"338.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"334.97\" y2=\"334.97\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"331.94\" y2=\"331.94\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"328.91\" y2=\"328.91\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"325.89\" y2=\"325.89\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"322.86\" y2=\"322.86\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"319.83\" y2=\"319.83\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"316.80\" y2=\"316.80\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"313.77\" y2=\"313.77\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"310.74\" y2=\"310.74\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"307.71\" y2=\"307.71\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"304.69\" y2=\"304.69\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"301.66\" y2=\"301.66\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"298.63\" y2=\"298.63\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"295.60\" y2=\"295.60\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"292.57\" y2=\"292.57\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"289.54\" y2=\"289.54\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"286.51\" y2=\"286.51\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"283.49\" y2=\"283.49\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"280.46\" y2=\"280.46\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"277.43\" y2=\"277.43\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"274.40\" y2=\"274.40\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"271.37\" y2=\"271.37\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"268.34\" y2=\"268.34\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"265.31\" y2=\"265.31\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"262.29\" y2=\"262.29\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"259.26\" y2=\"259.26\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"256.23\" y2=\"256.23\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"253.20\" y2=\"253.20\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"250.17\" y2=\"250.17\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"247.14\" y2=\"247.14\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"244.11\" y2=\"244.11\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"241.09\" y2=\"241.09\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"238.06\" y2=\"238.06\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"235.03\" y2=\"235.03\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"232.00\" y2=\"232.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"228.97\" y2=\"228.97\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"225.94\" y2=\"225.94\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"222.91\" y2=\"222.91\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"219.89\" y2=\"219.89\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"216.86\" y2=\"216.86\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"213.83\" y2=\"213.83\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"210.80\" y2=\"210.80\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"207.77\" y2=\"207.77\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"204.74\" y2=\"204.74\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"201.71\" y2=\"201.71\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"198.69\" y2=\"198.69\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"195.66\" y2=\"195.66\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"192.63\" y2=\"192.63\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"189.60\" y2=\"189.60\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"186.57\" y2=\"186.57\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"183.54\" y2=\"183.54\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"180.51\" y2=\"180.51\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"177.49\" y2=\"177.49\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"174.46\" y2=\"174.46\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"171.43\" y2=\"171.43\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"168.40\" y2=\"168.40\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"165.37\" y2=\"165.37\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"162.34\" y2=\"162.34\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"159.31\" y2=\"159.31\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"156.29\" y2=\"156.29\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"153.26\" y2=\"153.26\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"150.23\" y2=\"150.23\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"147.20\" y2=\"147.20\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"144.17\" y2=\"144.17\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"141.14\" y2=\"141.14\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"138.11\" y2=\"138.11\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"135.09\" y2=\"135.09\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"132.06\" y2=\"132.06\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"129.03\" y2=\"129.03\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"126.00\" y2=\"126.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"122.97\" y2=\"122.97\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"119.94\" y2=\"119.94\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"116.91\" y2=\"116.91\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"113.89\" y2=\"113.89\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"110.86\" y2=\"110.86\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"107.83\" y2=\"107.83\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"104.80\" y2=\"104.80\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"101.77\" y2=\"101.77\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"98.74\" y2=\"98.74\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"95.71\" y2=\"95.71\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"92.69\" y2=\"92.69\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"89.66\" y2=\"89.66\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"86.63\" y2=\"86.63\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"83.60\" y2=\"83.60\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"80.57\" y2=\"80.57\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"77.54\" y2=\"77.54\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"74.51\" y2=\"74.51\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"71.49\" y2=\"71.49\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"68.46\" y2=\"68.46\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"65.43\" y2=\"65.43\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"62.40\" y2=\"62.40\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"59.37\" y2=\"59.37\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"56.34\" y2=\"56.34\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"53.31\" y2=\"53.31\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"50.29\" y2=\"50.29\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"47.26\" y2=\"47.26\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"44.23\" y2=\"44.23\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"41.20\" y2=\"41.20\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"38.17\" y2=\"38.17\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"35.14\" y2=\"35.14\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"32.11\" y2=\"32.11\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"29.09\" y2=\"29.09\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"26.06\" y2=\"26.06\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"23.03\" y2=\"23.03\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"20.00\" y2=\"20.00\" /><g fill=\"black\" font-family=\"Arial, sans-serif\" font-size=\"10\" stroke=\"none\" text-anchor=\"end\"><text x=\"35.00\" y=\"550.00\">0.00</text><text x=\"35.00\" y=\"534.86\">1.00</text><text x=\"35.00\" y=\"519.71\">2.00</text><text x=\"35.00\" y=\"504.57\">3.00</text><text x=\"35.00\" y=\"489.43\">4.00</text><text x=\"35.00\" y=\"474.29\">5.00</text><text x=\"35.00\" y=\"459.14\">6.00</text><text x=\"35.00\" y=\"444.00\">7.00</text><text x=\"35.00\" y=\"428.86\">8.00</text><text x=\"35.00\" y=\"413.71\">9.00</text><text x=\"35.00\" y=\"398.57\">10.00</text><text x=\"35.00\" y=\"383.43\">11.00</text><text x=\"35.00\" y=\"368.29\">12.00</text><text x=\"35.00\" y=\"353.14\">13.00</text><text x=\"35.00\" y=\"338.00\">14.00</text><text x=\"35.00\" y=\"322.86\">15.00</text><text x=\"35.00\" y=\"307.71\">16.00</text><text x=\"35.00\" y=\"292.57\">17.00</text><text x=\"35.00\" y=\"277.43\">18.00</text><text x=\"35.00\" y=\"262.29\">19.00</text><text x=\"35.00\" y=\"247.14\">20.00</text><text x=\"35.00\" y=\"232.00\">21.00</text><text x=\"35.00\" y=\"216.86\">22.00</text><text x=\"35.00\" y=\"201.71\">23.00</text><text x=\"35.00\" y=\"186.57\">24.00</text><text x=\"35.00\" y=\"171.43\">25.00</text><text x=\"35.00\" y=\"156.29\">26.00</text><text x=\"35.00\" y=\"141.14\">27.00</text><text x=\"35.00\" y=\"126.00\">28.00</text><text x=\"35.00\" y=\"110.86\">29.00</text><text x=\"35.00\" y=\"95.71\">30.00</text><text x=\"35.00\" y=\"80.57\">31.00</text><text x=\"35.00\" y=\"65.43\">32.00</text><text x=\"35.00\" y=\"50.29\">33.00</text><text x=\"35.00\" y=\"35.14\">34.00</text><text x=\"35.00\" y=\"20.00\">35.00</text></g><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"20.00\" /></g></g></svg>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(-> (points-xy->plot path-points-1)\n",
    "    export-viz\n",
    "    display/make-html)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Create two variations of the path-along-x. Calculate the action. Show once again that the Lagrangian-action is indeed smallest for the straight path."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[375.0 383.8260332594603 410.3041330378416]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(defn make-varied-path [ε t0 t1]\n",
    " (+ path-along-x (* ε (make-η (up #(* 0 %) identity #(* 5.0 (sin %))) t0 t1))))\n",
    "\n",
    "(def small-varied-path (make-varied-path 0.01 0 10))\n",
    "(def large-varied-path (make-varied-path 0.02 0 10))\n",
    "\n",
    "[(Lagrangian-action (lg/L-free-particle 3.0) path-along-x 0.0 10.0)\n",
    " (Lagrangian-action (lg/L-free-particle 3.0) small-varied-path 0.0 10.0)\n",
    " (Lagrangian-action (lg/L-free-particle 3.0) large-varied-path 0.0 10.0)]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Create data to plot the three paths in the xz plane along with their actions."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "#'book-examples/path-points-2"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(def path-points-2\n",
    "    {orange (make-path-txyz path-along-x 0 10 50)\n",
    "     blue (make-path-txyz small-varied-path 0 10 50)\n",
    "     red (make-path-txyz large-varied-path 0 10 50)})"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Plot the three paths."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<?xml version=\"1.0\"?>\n",
       "<svg height=\"600\" version=\"1.1\" width=\"985\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\"><g><g stroke-dasharray=\"1 1\" stroke=\"#caa\"><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"68.50\" x2=\"68.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"87.00\" x2=\"87.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"105.50\" x2=\"105.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"124.00\" x2=\"124.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"142.50\" x2=\"142.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"161.00\" x2=\"161.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"179.50\" x2=\"179.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"198.00\" x2=\"198.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"216.50\" x2=\"216.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"235.00\" x2=\"235.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"253.50\" x2=\"253.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"272.00\" x2=\"272.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"290.50\" x2=\"290.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"309.00\" x2=\"309.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"327.50\" x2=\"327.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"346.00\" x2=\"346.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"364.50\" x2=\"364.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"383.00\" x2=\"383.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"401.50\" x2=\"401.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"420.00\" x2=\"420.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"438.50\" x2=\"438.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"457.00\" x2=\"457.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"475.50\" x2=\"475.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"494.00\" x2=\"494.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"512.50\" x2=\"512.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"531.00\" x2=\"531.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"549.50\" x2=\"549.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"568.00\" x2=\"568.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"586.50\" x2=\"586.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"605.00\" x2=\"605.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"623.50\" x2=\"623.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"642.00\" x2=\"642.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"660.50\" x2=\"660.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"679.00\" x2=\"679.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"697.50\" x2=\"697.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"716.00\" x2=\"716.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"734.50\" x2=\"734.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"753.00\" x2=\"753.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"771.50\" x2=\"771.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"790.00\" x2=\"790.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"808.50\" x2=\"808.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"827.00\" x2=\"827.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"845.50\" x2=\"845.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"864.00\" x2=\"864.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"882.50\" x2=\"882.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"901.00\" x2=\"901.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"919.50\" x2=\"919.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"938.00\" x2=\"938.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"956.50\" x2=\"956.50\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"975.00\" x2=\"975.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"377.75\" y2=\"377.75\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"198.88\" y2=\"198.88\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"20.00\" y2=\"20.00\" /></g><g stroke-width=\"2pt\" stroke=\"#f60\"><circle cx=\"50.00\" cy=\"20.00\" r=\"3\" /><circle cx=\"68.14\" cy=\"20.00\" r=\"3\" /><circle cx=\"86.27\" cy=\"20.00\" r=\"3\" /><circle cx=\"104.41\" cy=\"20.00\" r=\"3\" /><circle cx=\"122.55\" cy=\"20.00\" r=\"3\" /><circle cx=\"140.69\" cy=\"20.00\" r=\"3\" /><circle cx=\"158.82\" cy=\"20.00\" r=\"3\" /><circle cx=\"176.96\" cy=\"20.00\" r=\"3\" /><circle cx=\"195.10\" cy=\"20.00\" r=\"3\" /><circle cx=\"213.24\" cy=\"20.00\" r=\"3\" /><circle cx=\"231.37\" cy=\"20.00\" r=\"3\" /><circle cx=\"249.51\" cy=\"20.00\" r=\"3\" /><circle cx=\"267.65\" cy=\"20.00\" r=\"3\" /><circle cx=\"285.78\" cy=\"20.00\" r=\"3\" /><circle cx=\"303.92\" cy=\"20.00\" r=\"3\" /><circle cx=\"322.06\" cy=\"20.00\" r=\"3\" /><circle cx=\"340.20\" cy=\"20.00\" r=\"3\" /><circle cx=\"358.33\" cy=\"20.00\" r=\"3\" /><circle cx=\"376.47\" cy=\"20.00\" r=\"3\" /><circle cx=\"394.61\" cy=\"20.00\" r=\"3\" /><circle cx=\"412.75\" cy=\"20.00\" r=\"3\" /><circle cx=\"430.88\" cy=\"20.00\" r=\"3\" /><circle cx=\"449.02\" cy=\"20.00\" r=\"3\" /><circle cx=\"467.16\" cy=\"20.00\" r=\"3\" /><circle cx=\"485.29\" cy=\"20.00\" r=\"3\" /><circle cx=\"503.43\" cy=\"20.00\" r=\"3\" /><circle cx=\"521.57\" cy=\"20.00\" r=\"3\" /><circle cx=\"539.71\" cy=\"20.00\" r=\"3\" /><circle cx=\"557.84\" cy=\"20.00\" r=\"3\" /><circle cx=\"575.98\" cy=\"20.00\" r=\"3\" /><circle cx=\"594.12\" cy=\"20.00\" r=\"3\" /><circle cx=\"612.25\" cy=\"20.00\" r=\"3\" /><circle cx=\"630.39\" cy=\"20.00\" r=\"3\" /><circle cx=\"648.53\" cy=\"20.00\" r=\"3\" /><circle cx=\"666.67\" cy=\"20.00\" r=\"3\" /><circle cx=\"684.80\" cy=\"20.00\" r=\"3\" /><circle cx=\"702.94\" cy=\"20.00\" r=\"3\" /><circle cx=\"721.08\" cy=\"20.00\" r=\"3\" /><circle cx=\"739.22\" cy=\"20.00\" r=\"3\" /><circle cx=\"757.35\" cy=\"20.00\" r=\"3\" /><circle cx=\"775.49\" cy=\"20.00\" r=\"3\" /><circle cx=\"793.63\" cy=\"20.00\" r=\"3\" /><circle cx=\"811.76\" cy=\"20.00\" r=\"3\" /><circle cx=\"829.90\" cy=\"20.00\" r=\"3\" /><circle cx=\"848.04\" cy=\"20.00\" r=\"3\" /><circle cx=\"866.18\" cy=\"20.00\" r=\"3\" /><circle cx=\"884.31\" cy=\"20.00\" r=\"3\" /><circle cx=\"902.45\" cy=\"20.00\" r=\"3\" /><circle cx=\"920.59\" cy=\"20.00\" r=\"3\" /><circle cx=\"938.73\" cy=\"20.00\" r=\"3\" /><circle cx=\"956.86\" cy=\"20.00\" r=\"3\" /><circle cx=\"975.00\" cy=\"20.00\" r=\"3\" /></g><g stroke-width=\"2pt\" stroke=\"#0af\"><circle cx=\"50.00\" cy=\"20.00\" r=\"3\" /><circle cx=\"68.14\" cy=\"20.67\" r=\"3\" /><circle cx=\"86.27\" cy=\"22.64\" r=\"3\" /><circle cx=\"104.41\" cy=\"25.83\" r=\"3\" /><circle cx=\"122.55\" cy=\"30.14\" r=\"3\" /><circle cx=\"140.69\" cy=\"35.51\" r=\"3\" /><circle cx=\"158.82\" cy=\"41.85\" r=\"3\" /><circle cx=\"176.96\" cy=\"49.07\" r=\"3\" /><circle cx=\"195.10\" cy=\"57.11\" r=\"3\" /><circle cx=\"213.24\" cy=\"65.87\" r=\"3\" /><circle cx=\"231.37\" cy=\"75.29\" r=\"3\" /><circle cx=\"249.51\" cy=\"85.27\" r=\"3\" /><circle cx=\"267.65\" cy=\"95.73\" r=\"3\" /><circle cx=\"285.78\" cy=\"106.60\" r=\"3\" /><circle cx=\"303.92\" cy=\"117.79\" r=\"3\" /><circle cx=\"322.06\" cy=\"129.23\" r=\"3\" /><circle cx=\"340.20\" cy=\"140.82\" r=\"3\" /><circle cx=\"358.33\" cy=\"152.50\" r=\"3\" /><circle cx=\"376.47\" cy=\"164.18\" r=\"3\" /><circle cx=\"394.61\" cy=\"175.77\" r=\"3\" /><circle cx=\"412.75\" cy=\"187.21\" r=\"3\" /><circle cx=\"430.88\" cy=\"198.40\" r=\"3\" /><circle cx=\"449.02\" cy=\"209.27\" r=\"3\" /><circle cx=\"467.16\" cy=\"219.73\" r=\"3\" /><circle cx=\"485.29\" cy=\"229.71\" r=\"3\" /><circle cx=\"503.43\" cy=\"239.13\" r=\"3\" /><circle cx=\"521.57\" cy=\"247.89\" r=\"3\" /><circle cx=\"539.71\" cy=\"255.93\" r=\"3\" /><circle cx=\"557.84\" cy=\"263.15\" r=\"3\" /><circle cx=\"575.98\" cy=\"269.49\" r=\"3\" /><circle cx=\"594.12\" cy=\"274.86\" r=\"3\" /><circle cx=\"612.25\" cy=\"279.17\" r=\"3\" /><circle cx=\"630.39\" cy=\"282.36\" r=\"3\" /><circle cx=\"648.53\" cy=\"284.33\" r=\"3\" /><circle cx=\"666.67\" cy=\"285.00\" r=\"3\" /><circle cx=\"684.80\" cy=\"284.30\" r=\"3\" /><circle cx=\"702.94\" cy=\"282.14\" r=\"3\" /><circle cx=\"721.08\" cy=\"278.45\" r=\"3\" /><circle cx=\"739.22\" cy=\"273.13\" r=\"3\" /><circle cx=\"757.35\" cy=\"266.12\" r=\"3\" /><circle cx=\"775.49\" cy=\"257.33\" r=\"3\" /><circle cx=\"793.63\" cy=\"246.68\" r=\"3\" /><circle cx=\"811.76\" cy=\"234.08\" r=\"3\" /><circle cx=\"829.90\" cy=\"219.46\" r=\"3\" /><circle cx=\"848.04\" cy=\"202.74\" r=\"3\" /><circle cx=\"866.18\" cy=\"183.84\" r=\"3\" /><circle cx=\"884.31\" cy=\"162.67\" r=\"3\" /><circle cx=\"902.45\" cy=\"139.15\" r=\"3\" /><circle cx=\"920.59\" cy=\"113.21\" r=\"3\" /><circle cx=\"938.73\" cy=\"84.75\" r=\"3\" /><circle cx=\"956.86\" cy=\"53.71\" r=\"3\" /><circle cx=\"975.00\" cy=\"20.00\" r=\"3\" /></g><g stroke-width=\"2pt\" stroke=\"#f00\"><circle cx=\"50.00\" cy=\"20.00\" r=\"3\" /><circle cx=\"68.14\" cy=\"21.35\" r=\"3\" /><circle cx=\"86.27\" cy=\"25.29\" r=\"3\" /><circle cx=\"104.41\" cy=\"31.65\" r=\"3\" /><circle cx=\"122.55\" cy=\"40.28\" r=\"3\" /><circle cx=\"140.69\" cy=\"51.01\" r=\"3\" /><circle cx=\"158.82\" cy=\"63.69\" r=\"3\" /><circle cx=\"176.96\" cy=\"78.15\" r=\"3\" /><circle cx=\"195.10\" cy=\"94.22\" r=\"3\" /><circle cx=\"213.24\" cy=\"111.75\" r=\"3\" /><circle cx=\"231.37\" cy=\"130.57\" r=\"3\" /><circle cx=\"249.51\" cy=\"150.53\" r=\"3\" /><circle cx=\"267.65\" cy=\"171.46\" r=\"3\" /><circle cx=\"285.78\" cy=\"193.20\" r=\"3\" /><circle cx=\"303.92\" cy=\"215.58\" r=\"3\" /><circle cx=\"322.06\" cy=\"238.45\" r=\"3\" /><circle cx=\"340.20\" cy=\"261.64\" r=\"3\" /><circle cx=\"358.33\" cy=\"285.00\" r=\"3\" /><circle cx=\"376.47\" cy=\"308.36\" r=\"3\" /><circle cx=\"394.61\" cy=\"331.55\" r=\"3\" /><circle cx=\"412.75\" cy=\"354.42\" r=\"3\" /><circle cx=\"430.88\" cy=\"376.80\" r=\"3\" /><circle cx=\"449.02\" cy=\"398.54\" r=\"3\" /><circle cx=\"467.16\" cy=\"419.47\" r=\"3\" /><circle cx=\"485.29\" cy=\"439.43\" r=\"3\" /><circle cx=\"503.43\" cy=\"458.25\" r=\"3\" /><circle cx=\"521.57\" cy=\"475.78\" r=\"3\" /><circle cx=\"539.71\" cy=\"491.85\" r=\"3\" /><circle cx=\"557.84\" cy=\"506.31\" r=\"3\" /><circle cx=\"575.98\" cy=\"518.99\" r=\"3\" /><circle cx=\"594.12\" cy=\"529.72\" r=\"3\" /><circle cx=\"612.25\" cy=\"538.35\" r=\"3\" /><circle cx=\"630.39\" cy=\"544.71\" r=\"3\" /><circle cx=\"648.53\" cy=\"548.65\" r=\"3\" /><circle cx=\"666.67\" cy=\"550.00\" r=\"3\" /><circle cx=\"684.80\" cy=\"548.60\" r=\"3\" /><circle cx=\"702.94\" cy=\"544.28\" r=\"3\" /><circle cx=\"721.08\" cy=\"536.89\" r=\"3\" /><circle cx=\"739.22\" cy=\"526.27\" r=\"3\" /><circle cx=\"757.35\" cy=\"512.24\" r=\"3\" /><circle cx=\"775.49\" cy=\"494.66\" r=\"3\" /><circle cx=\"793.63\" cy=\"473.35\" r=\"3\" /><circle cx=\"811.76\" cy=\"448.16\" r=\"3\" /><circle cx=\"829.90\" cy=\"418.93\" r=\"3\" /><circle cx=\"848.04\" cy=\"385.49\" r=\"3\" /><circle cx=\"866.18\" cy=\"347.68\" r=\"3\" /><circle cx=\"884.31\" cy=\"305.33\" r=\"3\" /><circle cx=\"902.45\" cy=\"258.30\" r=\"3\" /><circle cx=\"920.59\" cy=\"206.41\" r=\"3\" /><circle cx=\"938.73\" cy=\"149.51\" r=\"3\" /><circle cx=\"956.86\" cy=\"87.42\" r=\"3\" /><circle cx=\"975.00\" cy=\"20.00\" r=\"3\" /></g><g stroke=\"black\"><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"68.50\" x2=\"68.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"87.00\" x2=\"87.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"105.50\" x2=\"105.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"124.00\" x2=\"124.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"142.50\" x2=\"142.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"161.00\" x2=\"161.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"179.50\" x2=\"179.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"198.00\" x2=\"198.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"216.50\" x2=\"216.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"235.00\" x2=\"235.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"253.50\" x2=\"253.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"272.00\" x2=\"272.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"290.50\" x2=\"290.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"309.00\" x2=\"309.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"327.50\" x2=\"327.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"346.00\" x2=\"346.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"364.50\" x2=\"364.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"383.00\" x2=\"383.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"401.50\" x2=\"401.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"420.00\" x2=\"420.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"438.50\" x2=\"438.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"457.00\" x2=\"457.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"475.50\" x2=\"475.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"494.00\" x2=\"494.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"512.50\" x2=\"512.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"531.00\" x2=\"531.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"549.50\" x2=\"549.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"568.00\" x2=\"568.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"586.50\" x2=\"586.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"605.00\" x2=\"605.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"623.50\" x2=\"623.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"642.00\" x2=\"642.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"660.50\" x2=\"660.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"679.00\" x2=\"679.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"697.50\" x2=\"697.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"716.00\" x2=\"716.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"734.50\" x2=\"734.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"753.00\" x2=\"753.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"771.50\" x2=\"771.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"790.00\" x2=\"790.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"808.50\" x2=\"808.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"827.00\" x2=\"827.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"845.50\" x2=\"845.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"864.00\" x2=\"864.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"882.50\" x2=\"882.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"901.00\" x2=\"901.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"919.50\" x2=\"919.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"938.00\" x2=\"938.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"956.50\" x2=\"956.50\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"975.00\" x2=\"975.00\" y1=\"550.00\" y2=\"560.00\" /><g fill=\"black\" font-family=\"Arial, sans-serif\" font-size=\"10\" stroke=\"none\" text-anchor=\"middle\"><text x=\"50.00\" y=\"570.00\">1.00</text><text x=\"68.50\" y=\"570.00\">2.00</text><text x=\"87.00\" y=\"570.00\">3.00</text><text x=\"105.50\" y=\"570.00\">4.00</text><text x=\"124.00\" y=\"570.00\">5.00</text><text x=\"142.50\" y=\"570.00\">6.00</text><text x=\"161.00\" y=\"570.00\">7.00</text><text x=\"179.50\" y=\"570.00\">8.00</text><text x=\"198.00\" y=\"570.00\">9.00</text><text x=\"216.50\" y=\"570.00\">10.00</text><text x=\"235.00\" y=\"570.00\">11.00</text><text x=\"253.50\" y=\"570.00\">12.00</text><text x=\"272.00\" y=\"570.00\">13.00</text><text x=\"290.50\" y=\"570.00\">14.00</text><text x=\"309.00\" y=\"570.00\">15.00</text><text x=\"327.50\" y=\"570.00\">16.00</text><text x=\"346.00\" y=\"570.00\">17.00</text><text x=\"364.50\" y=\"570.00\">18.00</text><text x=\"383.00\" y=\"570.00\">19.00</text><text x=\"401.50\" y=\"570.00\">20.00</text><text x=\"420.00\" y=\"570.00\">21.00</text><text x=\"438.50\" y=\"570.00\">22.00</text><text x=\"457.00\" y=\"570.00\">23.00</text><text x=\"475.50\" y=\"570.00\">24.00</text><text x=\"494.00\" y=\"570.00\">25.00</text><text x=\"512.50\" y=\"570.00\">26.00</text><text x=\"531.00\" y=\"570.00\">27.00</text><text x=\"549.50\" y=\"570.00\">28.00</text><text x=\"568.00\" y=\"570.00\">29.00</text><text x=\"586.50\" y=\"570.00\">30.00</text><text x=\"605.00\" y=\"570.00\">31.00</text><text x=\"623.50\" y=\"570.00\">32.00</text><text x=\"642.00\" y=\"570.00\">33.00</text><text x=\"660.50\" y=\"570.00\">34.00</text><text x=\"679.00\" y=\"570.00\">35.00</text><text x=\"697.50\" y=\"570.00\">36.00</text><text x=\"716.00\" y=\"570.00\">37.00</text><text x=\"734.50\" y=\"570.00\">38.00</text><text x=\"753.00\" y=\"570.00\">39.00</text><text x=\"771.50\" y=\"570.00\">40.00</text><text x=\"790.00\" y=\"570.00\">41.00</text><text x=\"808.50\" y=\"570.00\">42.00</text><text x=\"827.00\" y=\"570.00\">43.00</text><text x=\"845.50\" y=\"570.00\">44.00</text><text x=\"864.00\" y=\"570.00\">45.00</text><text x=\"882.50\" y=\"570.00\">46.00</text><text x=\"901.00\" y=\"570.00\">47.00</text><text x=\"919.50\" y=\"570.00\">48.00</text><text x=\"938.00\" y=\"570.00\">49.00</text><text x=\"956.50\" y=\"570.00\">50.00</text><text x=\"975.00\" y=\"570.00\">51.00</text></g><line x1=\"50.00\" x2=\"975.00\" y1=\"550.00\" y2=\"550.00\" /></g><g stroke=\"black\"><line x1=\"50.00\" x2=\"40.00\" y1=\"377.75\" y2=\"377.75\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"198.88\" y2=\"198.88\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"20.00\" y2=\"20.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"520.85\" y2=\"520.85\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"485.08\" y2=\"485.08\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"449.30\" y2=\"449.30\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"413.52\" y2=\"413.52\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"377.75\" y2=\"377.75\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"341.98\" y2=\"341.98\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"306.20\" y2=\"306.20\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"270.42\" y2=\"270.42\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"234.65\" y2=\"234.65\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"198.88\" y2=\"198.88\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"163.10\" y2=\"163.10\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"127.32\" y2=\"127.32\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"91.55\" y2=\"91.55\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"55.78\" y2=\"55.78\" /><g fill=\"black\" font-family=\"Arial, sans-serif\" font-size=\"10\" stroke=\"none\" text-anchor=\"end\"><text x=\"35.00\" y=\"377.75\">-2.00</text><text x=\"35.00\" y=\"198.88\">-1.00</text><text x=\"35.00\" y=\"20.00\">0.00</text></g><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"20.00\" /></g></g></svg>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(-> (points-xy->plot path-points-2)\n",
    "    export-viz\n",
    "    display/make-html)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Finding trajectories that minimize the action"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The SICM library provides a procedure that constructs a one dimensional path (along, say, the z axis) using an interpolation polynomial: `(make-path t0 q0 t1 q1 qs)`, where q0 and q1 are the endpoints, t0 and t1 are the corresponding times, and qs is a list of intermediate points. I give an example (note that the result, `initial-path`, is itself a function):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "#'book-examples/initial-path"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(def pi-half (* 0.5 Math/PI))\n",
    "(def initial-qs [0.1 0.2 0.2])\n",
    "(def initial-path (lg/make-path 0 1.0 pi-half 0.0 initial-qs))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Construct a parametric action that is just the action computed along that parametric path. Find approximate solution paths of a free particle and the harmonic oszillator respectively (hint: use the SICM procedure `multidimensional-minimize`)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "#'book-examples/harmonic-path"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(defn parametric-path-actn\n",
    "  [Lagrangian t0 q0 t1 q1]\n",
    "  (fn [qs]\n",
    "    (let [path (lg/make-path t0 q0 t1 q1 qs)]\n",
    "      (Lagrangian-action Lagrangian path t0 t1))))\n",
    "\n",
    "(defn fnd-path\n",
    "  [Lagrangian t0 q0 t1 q1 initial-qs]\n",
    "  (let [minimizing-qs\n",
    "        (mn/multidimensional-minimize\n",
    "          (parametric-path-actn Lagrangian t0 q0 t1 q1)\n",
    "          initial-qs)]\n",
    "    (lg/make-path t0 q0 t1 q1 minimizing-qs)))\n",
    "\n",
    "(def free-path \n",
    "  (fnd-path (lg/L-free-particle 3.0) 0.0 1.0 pi-half 0.0 initial-qs))\n",
    "\n",
    "(def harmonic-path \n",
    "  (fnd-path (lg/L-harmonic 1.0 1.0) 0.0 1.0 pi-half 0.0 initial-qs))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Make a plot of these one dimensional paths, this time not in the x-z plane but in the t-z plane. This shows that, upon optimization, the initial-path turns into a streight line and a sinusoidal curve respectively."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "#'book-examples/plot-3"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(defn make-path-tz [fn_t t0 t1 nofsteps]\n",
    "  (map #(vector % 0 0 (fn_t %)) (alt-range t0 t1 nofsteps)))\n",
    "\n",
    "(def plot-3\n",
    "    (let [i (make-path-tz initial-path 0 pi-half 50)\n",
    "          f (make-path-tz free-path 0 pi-half 50)\n",
    "          h (make-path-tz harmonic-path 0 pi-half 50)]\n",
    "      {orange i blue f red h}))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<?xml version=\"1.0\"?>\n",
       "<svg height=\"600\" version=\"1.1\" width=\"985\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\"><g><g stroke-dasharray=\"1 1\" stroke=\"#caa\"><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"638.87\" x2=\"638.87\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"550.00\" y2=\"550.00\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"20.00\" y2=\"20.00\" /></g><g stroke-width=\"2pt\" stroke=\"#f60\"><circle cx=\"50.00\" cy=\"20.00\" r=\"3\" /><circle cx=\"68.14\" cy=\"99.02\" r=\"3\" /><circle cx=\"86.27\" cy=\"168.86\" r=\"3\" /><circle cx=\"104.41\" cy=\"230.16\" r=\"3\" /><circle cx=\"122.55\" cy=\"283.52\" r=\"3\" /><circle cx=\"140.69\" cy=\"329.54\" r=\"3\" /><circle cx=\"158.82\" cy=\"368.80\" r=\"3\" /><circle cx=\"176.96\" cy=\"401.85\" r=\"3\" /><circle cx=\"195.10\" cy=\"429.22\" r=\"3\" /><circle cx=\"213.24\" cy=\"451.44\" r=\"3\" /><circle cx=\"231.37\" cy=\"468.99\" r=\"3\" /><circle cx=\"249.51\" cy=\"482.35\" r=\"3\" /><circle cx=\"267.65\" cy=\"491.97\" r=\"3\" /><circle cx=\"285.78\" cy=\"498.29\" r=\"3\" /><circle cx=\"303.92\" cy=\"501.72\" r=\"3\" /><circle cx=\"322.06\" cy=\"502.66\" r=\"3\" /><circle cx=\"340.20\" cy=\"501.48\" r=\"3\" /><circle cx=\"358.33\" cy=\"498.53\" r=\"3\" /><circle cx=\"376.47\" cy=\"494.14\" r=\"3\" /><circle cx=\"394.61\" cy=\"488.64\" r=\"3\" /><circle cx=\"412.75\" cy=\"482.32\" r=\"3\" /><circle cx=\"430.88\" cy=\"475.44\" r=\"3\" /><circle cx=\"449.02\" cy=\"468.26\" r=\"3\" /><circle cx=\"467.16\" cy=\"461.02\" r=\"3\" /><circle cx=\"485.29\" cy=\"453.93\" r=\"3\" /><circle cx=\"503.43\" cy=\"447.19\" r=\"3\" /><circle cx=\"521.57\" cy=\"440.96\" r=\"3\" /><circle cx=\"539.71\" cy=\"435.40\" r=\"3\" /><circle cx=\"557.84\" cy=\"430.65\" r=\"3\" /><circle cx=\"575.98\" cy=\"426.81\" r=\"3\" /><circle cx=\"594.12\" cy=\"423.98\" r=\"3\" /><circle cx=\"612.25\" cy=\"422.24\" r=\"3\" /><circle cx=\"630.39\" cy=\"421.63\" r=\"3\" /><circle cx=\"648.53\" cy=\"422.19\" r=\"3\" /><circle cx=\"666.67\" cy=\"423.93\" r=\"3\" /><circle cx=\"684.80\" cy=\"426.85\" r=\"3\" /><circle cx=\"702.94\" cy=\"430.92\" r=\"3\" /><circle cx=\"721.08\" cy=\"436.09\" r=\"3\" /><circle cx=\"739.22\" cy=\"442.30\" r=\"3\" /><circle cx=\"757.35\" cy=\"449.45\" r=\"3\" /><circle cx=\"775.49\" cy=\"457.44\" r=\"3\" /><circle cx=\"793.63\" cy=\"466.14\" r=\"3\" /><circle cx=\"811.76\" cy=\"475.41\" r=\"3\" /><circle cx=\"829.90\" cy=\"485.08\" r=\"3\" /><circle cx=\"848.04\" cy=\"494.95\" r=\"3\" /><circle cx=\"866.18\" cy=\"504.83\" r=\"3\" /><circle cx=\"884.31\" cy=\"514.48\" r=\"3\" /><circle cx=\"902.45\" cy=\"523.66\" r=\"3\" /><circle cx=\"920.59\" cy=\"532.10\" r=\"3\" /><circle cx=\"938.73\" cy=\"539.51\" r=\"3\" /><circle cx=\"956.86\" cy=\"545.59\" r=\"3\" /><circle cx=\"975.00\" cy=\"550.00\" r=\"3\" /></g><g stroke-width=\"2pt\" stroke=\"#0af\"><circle cx=\"50.00\" cy=\"20.00\" r=\"3\" /><circle cx=\"68.14\" cy=\"30.39\" r=\"3\" /><circle cx=\"86.27\" cy=\"40.78\" r=\"3\" /><circle cx=\"104.41\" cy=\"51.18\" r=\"3\" /><circle cx=\"122.55\" cy=\"61.57\" r=\"3\" /><circle cx=\"140.69\" cy=\"71.96\" r=\"3\" /><circle cx=\"158.82\" cy=\"82.35\" r=\"3\" /><circle cx=\"176.96\" cy=\"92.75\" r=\"3\" /><circle cx=\"195.10\" cy=\"103.14\" r=\"3\" /><circle cx=\"213.24\" cy=\"113.53\" r=\"3\" /><circle cx=\"231.37\" cy=\"123.92\" r=\"3\" /><circle cx=\"249.51\" cy=\"134.31\" r=\"3\" /><circle cx=\"267.65\" cy=\"144.71\" r=\"3\" /><circle cx=\"285.78\" cy=\"155.10\" r=\"3\" /><circle cx=\"303.92\" cy=\"165.49\" r=\"3\" /><circle cx=\"322.06\" cy=\"175.88\" r=\"3\" /><circle cx=\"340.20\" cy=\"186.27\" r=\"3\" /><circle cx=\"358.33\" cy=\"196.67\" r=\"3\" /><circle cx=\"376.47\" cy=\"207.06\" r=\"3\" /><circle cx=\"394.61\" cy=\"217.45\" r=\"3\" /><circle cx=\"412.75\" cy=\"227.84\" r=\"3\" /><circle cx=\"430.88\" cy=\"238.23\" r=\"3\" /><circle cx=\"449.02\" cy=\"248.63\" r=\"3\" /><circle cx=\"467.16\" cy=\"259.02\" r=\"3\" /><circle cx=\"485.29\" cy=\"269.41\" r=\"3\" /><circle cx=\"503.43\" cy=\"279.80\" r=\"3\" /><circle cx=\"521.57\" cy=\"290.19\" r=\"3\" /><circle cx=\"539.71\" cy=\"300.59\" r=\"3\" /><circle cx=\"557.84\" cy=\"310.98\" r=\"3\" /><circle cx=\"575.98\" cy=\"321.37\" r=\"3\" /><circle cx=\"594.12\" cy=\"331.76\" r=\"3\" /><circle cx=\"612.25\" cy=\"342.16\" r=\"3\" /><circle cx=\"630.39\" cy=\"352.55\" r=\"3\" /><circle cx=\"648.53\" cy=\"362.94\" r=\"3\" /><circle cx=\"666.67\" cy=\"373.33\" r=\"3\" /><circle cx=\"684.80\" cy=\"383.72\" r=\"3\" /><circle cx=\"702.94\" cy=\"394.12\" r=\"3\" /><circle cx=\"721.08\" cy=\"404.51\" r=\"3\" /><circle cx=\"739.22\" cy=\"414.90\" r=\"3\" /><circle cx=\"757.35\" cy=\"425.29\" r=\"3\" /><circle cx=\"775.49\" cy=\"435.68\" r=\"3\" /><circle cx=\"793.63\" cy=\"446.08\" r=\"3\" /><circle cx=\"811.76\" cy=\"456.47\" r=\"3\" /><circle cx=\"829.90\" cy=\"466.86\" r=\"3\" /><circle cx=\"848.04\" cy=\"477.25\" r=\"3\" /><circle cx=\"866.18\" cy=\"487.65\" r=\"3\" /><circle cx=\"884.31\" cy=\"498.04\" r=\"3\" /><circle cx=\"902.45\" cy=\"508.43\" r=\"3\" /><circle cx=\"920.59\" cy=\"518.82\" r=\"3\" /><circle cx=\"938.73\" cy=\"529.22\" r=\"3\" /><circle cx=\"956.86\" cy=\"539.61\" r=\"3\" /><circle cx=\"975.00\" cy=\"550.00\" r=\"3\" /></g><g stroke-width=\"2pt\" stroke=\"#f00\"><circle cx=\"50.00\" cy=\"20.00\" r=\"3\" /><circle cx=\"68.14\" cy=\"20.22\" r=\"3\" /><circle cx=\"86.27\" cy=\"20.96\" r=\"3\" /><circle cx=\"104.41\" cy=\"22.20\" r=\"3\" /><circle cx=\"122.55\" cy=\"23.96\" r=\"3\" /><circle cx=\"140.69\" cy=\"26.22\" r=\"3\" /><circle cx=\"158.82\" cy=\"28.98\" r=\"3\" /><circle cx=\"176.96\" cy=\"32.24\" r=\"3\" /><circle cx=\"195.10\" cy=\"35.99\" r=\"3\" /><circle cx=\"213.24\" cy=\"40.23\" r=\"3\" /><circle cx=\"231.37\" cy=\"44.96\" r=\"3\" /><circle cx=\"249.51\" cy=\"50.16\" r=\"3\" /><circle cx=\"267.65\" cy=\"55.84\" r=\"3\" /><circle cx=\"285.78\" cy=\"61.98\" r=\"3\" /><circle cx=\"303.92\" cy=\"68.58\" r=\"3\" /><circle cx=\"322.06\" cy=\"75.64\" r=\"3\" /><circle cx=\"340.20\" cy=\"83.15\" r=\"3\" /><circle cx=\"358.33\" cy=\"91.09\" r=\"3\" /><circle cx=\"376.47\" cy=\"99.47\" r=\"3\" /><circle cx=\"394.61\" cy=\"108.27\" r=\"3\" /><circle cx=\"412.75\" cy=\"117.49\" r=\"3\" /><circle cx=\"430.88\" cy=\"127.12\" r=\"3\" /><circle cx=\"449.02\" cy=\"137.14\" r=\"3\" /><circle cx=\"467.16\" cy=\"147.56\" r=\"3\" /><circle cx=\"485.29\" cy=\"158.35\" r=\"3\" /><circle cx=\"503.43\" cy=\"169.52\" r=\"3\" /><circle cx=\"521.57\" cy=\"181.05\" r=\"3\" /><circle cx=\"539.71\" cy=\"192.92\" r=\"3\" /><circle cx=\"557.84\" cy=\"205.14\" r=\"3\" /><circle cx=\"575.98\" cy=\"217.68\" r=\"3\" /><circle cx=\"594.12\" cy=\"230.54\" r=\"3\" /><circle cx=\"612.25\" cy=\"243.71\" r=\"3\" /><circle cx=\"630.39\" cy=\"257.17\" r=\"3\" /><circle cx=\"648.53\" cy=\"270.91\" r=\"3\" /><circle cx=\"666.67\" cy=\"284.91\" r=\"3\" /><circle cx=\"684.80\" cy=\"299.17\" r=\"3\" /><circle cx=\"702.94\" cy=\"313.67\" r=\"3\" /><circle cx=\"721.08\" cy=\"328.40\" r=\"3\" /><circle cx=\"739.22\" cy=\"343.34\" r=\"3\" /><circle cx=\"757.35\" cy=\"358.48\" r=\"3\" /><circle cx=\"775.49\" cy=\"373.81\" r=\"3\" /><circle cx=\"793.63\" cy=\"389.30\" r=\"3\" /><circle cx=\"811.76\" cy=\"404.95\" r=\"3\" /><circle cx=\"829.90\" cy=\"420.74\" r=\"3\" /><circle cx=\"848.04\" cy=\"436.64\" r=\"3\" /><circle cx=\"866.18\" cy=\"452.66\" r=\"3\" /><circle cx=\"884.31\" cy=\"468.76\" r=\"3\" /><circle cx=\"902.45\" cy=\"484.93\" r=\"3\" /><circle cx=\"920.59\" cy=\"501.16\" r=\"3\" /><circle cx=\"938.73\" cy=\"517.43\" r=\"3\" /><circle cx=\"956.86\" cy=\"533.71\" r=\"3\" /><circle cx=\"975.00\" cy=\"550.00\" r=\"3\" /></g><g stroke=\"black\"><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"638.87\" x2=\"638.87\" y1=\"550.00\" y2=\"560.00\" /><g fill=\"black\" font-family=\"Arial, sans-serif\" font-size=\"10\" stroke=\"none\" text-anchor=\"middle\"><text x=\"50.00\" y=\"570.00\">0.00</text><text x=\"638.87\" y=\"570.00\">1.00</text></g><line x1=\"50.00\" x2=\"975.00\" y1=\"550.00\" y2=\"550.00\" /></g><g stroke=\"black\"><line x1=\"50.00\" x2=\"40.00\" y1=\"550.00\" y2=\"550.00\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"20.00\" y2=\"20.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"550.00\" y2=\"550.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"444.00\" y2=\"444.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"338.00\" y2=\"338.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"232.00\" y2=\"232.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"126.00\" y2=\"126.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"20.00\" y2=\"20.00\" /><g fill=\"black\" font-family=\"Arial, sans-serif\" font-size=\"10\" stroke=\"none\" text-anchor=\"end\"><text x=\"35.00\" y=\"550.00\">0.00</text><text x=\"35.00\" y=\"20.00\">1.00</text></g><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"20.00\" /></g></g></svg>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(-> (points-tz->plot plot-3)\n",
    "    export-viz\n",
    "    display/make-html)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Show that your numerically attained harmonic-path approximates the well known analytic solution $x(t) = cos(t)$."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<?xml version=\"1.0\"?>\n",
       "<svg height=\"600\" version=\"1.1\" width=\"985\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\"><g><g stroke-dasharray=\"1 1\" stroke=\"#caa\"><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"638.87\" x2=\"638.87\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"277.96\" y2=\"277.96\" /></g><g stroke-width=\"2pt\" stroke=\"#f60\"><circle cx=\"50.00\" cy=\"277.96\" r=\"3\" /><circle cx=\"68.14\" cy=\"369.66\" r=\"3\" /><circle cx=\"86.27\" cy=\"426.19\" r=\"3\" /><circle cx=\"104.41\" cy=\"453.48\" r=\"3\" /><circle cx=\"122.55\" cy=\"456.95\" r=\"3\" /><circle cx=\"140.69\" cy=\"441.61\" r=\"3\" /><circle cx=\"158.82\" cy=\"412.00\" r=\"3\" /><circle cx=\"176.96\" cy=\"372.22\" r=\"3\" /><circle cx=\"195.10\" cy=\"325.95\" r=\"3\" /><circle cx=\"213.24\" cy=\"276.41\" r=\"3\" /><circle cx=\"231.37\" cy=\"226.43\" r=\"3\" /><circle cx=\"249.51\" cy=\"178.43\" r=\"3\" /><circle cx=\"267.65\" cy=\"134.44\" r=\"3\" /><circle cx=\"285.78\" cy=\"96.11\" r=\"3\" /><circle cx=\"303.92\" cy=\"64.72\" r=\"3\" /><circle cx=\"322.06\" cy=\"41.21\" r=\"3\" /><circle cx=\"340.20\" cy=\"26.20\" r=\"3\" /><circle cx=\"358.33\" cy=\"20.00\" r=\"3\" /><circle cx=\"376.47\" cy=\"22.62\" r=\"3\" /><circle cx=\"394.61\" cy=\"33.82\" r=\"3\" /><circle cx=\"412.75\" cy=\"53.12\" r=\"3\" /><circle cx=\"430.88\" cy=\"79.79\" r=\"3\" /><circle cx=\"449.02\" cy=\"112.95\" r=\"3\" /><circle cx=\"467.16\" cy=\"151.53\" r=\"3\" /><circle cx=\"485.29\" cy=\"194.32\" r=\"3\" /><circle cx=\"503.43\" cy=\"240.00\" r=\"3\" /><circle cx=\"521.57\" cy=\"287.19\" r=\"3\" /><circle cx=\"539.71\" cy=\"334.42\" r=\"3\" /><circle cx=\"557.84\" cy=\"380.24\" r=\"3\" /><circle cx=\"575.98\" cy=\"423.20\" r=\"3\" /><circle cx=\"594.12\" cy=\"461.90\" r=\"3\" /><circle cx=\"612.25\" cy=\"495.00\" r=\"3\" /><circle cx=\"630.39\" cy=\"521.32\" r=\"3\" /><circle cx=\"648.53\" cy=\"539.79\" r=\"3\" /><circle cx=\"666.67\" cy=\"549.56\" r=\"3\" /><circle cx=\"684.80\" cy=\"550.00\" r=\"3\" /><circle cx=\"702.94\" cy=\"540.75\" r=\"3\" /><circle cx=\"721.08\" cy=\"521.74\" r=\"3\" /><circle cx=\"739.22\" cy=\"493.26\" r=\"3\" /><circle cx=\"757.35\" cy=\"456.00\" r=\"3\" /><circle cx=\"775.49\" cy=\"411.04\" r=\"3\" /><circle cx=\"793.63\" cy=\"359.96\" r=\"3\" /><circle cx=\"811.76\" cy=\"304.83\" r=\"3\" /><circle cx=\"829.90\" cy=\"248.30\" r=\"3\" /><circle cx=\"848.04\" cy=\"193.59\" r=\"3\" /><circle cx=\"866.18\" cy=\"144.56\" r=\"3\" /><circle cx=\"884.31\" cy=\"105.76\" r=\"3\" /><circle cx=\"902.45\" cy=\"82.48\" r=\"3\" /><circle cx=\"920.59\" cy=\"80.77\" r=\"3\" /><circle cx=\"938.73\" cy=\"107.47\" r=\"3\" /><circle cx=\"956.86\" cy=\"170.33\" r=\"3\" /><circle cx=\"975.00\" cy=\"277.96\" r=\"3\" /></g><g stroke=\"black\"><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"638.87\" x2=\"638.87\" y1=\"550.00\" y2=\"560.00\" /><g fill=\"black\" font-family=\"Arial, sans-serif\" font-size=\"10\" stroke=\"none\" text-anchor=\"middle\"><text x=\"50.00\" y=\"570.00\">0.00</text><text x=\"638.87\" y=\"570.00\">1.00</text></g><line x1=\"50.00\" x2=\"975.00\" y1=\"550.00\" y2=\"550.00\" /></g><g stroke=\"black\"><line x1=\"50.00\" x2=\"40.00\" y1=\"277.96\" y2=\"277.96\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"277.96\" y2=\"277.96\" /><g fill=\"black\" font-family=\"Arial, sans-serif\" font-size=\"10\" stroke=\"none\" text-anchor=\"end\"><text x=\"35.00\" y=\"277.96\">0.00</text></g><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"20.00\" /></g></g></svg>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(-> (points-tz->plot\n",
    "     {orange \n",
    "      (make-path-tz #(- (cos %) (harmonic-path %)) 0 pi-half 50)})\n",
    "    export-viz\n",
    "    display/make-html)\n",
    "\n",
    ";Here the y-axis lacks tick marks. The graph in fact makes very very small oscillations around zero.\n",
    ";This plot badly needs improvement at least in that respect."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Calculate the Lagrange equation of the harmonic oszillator."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$$k\\,q\\left(t\\right) + m\\,{D}^{2}q\\left(t\\right)$$"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(tex (((Lagrange-equations (lg/L-harmonic 'm 'k)) (literal-function 'q)) 't))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.5 The Euler-Lagrange Equations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.5.2 Computing Lagrange's Equations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### The free particle"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "State the dynamic equation of motion (i.e. the Lagrange equation a.k.a Newton's second law) of the free particle."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$$m\\,{D}^{2}q\\left(t\\right)$$"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(tex (((Lagrange-equations (lg/L-free-particle 'm)) (literal-function 'q)) 't))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Check that an arbitrary straight-line path satisfies this equation, i.e. that inserting a straight line for $q(t)$ gives identically zero (strictly speaking the zero covector of three dimensions)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$$\\begin{bmatrix}0&0&0\\end{bmatrix}$$"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(letfn [(straight-line [t]\n",
    "  (up (+ (* 'a t) 'a0)\n",
    "    (+ (* 'b t) 'b0)\n",
    "    (+ (* 'c t) 'c0)))]\n",
    "   (tex (((Lagrange-equations (lg/L-free-particle 'm)) straight-line) 't)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### The harmonic oscillator"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "State the dynamic equation of motion for the harmonic oszillator with arbitrary mass and spring constant."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$$k\\,q\\left(t\\right) + m\\,{D}^{2}q\\left(t\\right)$$"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(tex (((Lagrange-equations (lg/L-harmonic 'm 'k)) (literal-function 'q)) 't))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Plug in a sinusoid with arbitrary amplitude $A$, frequency $\\omega$ and phase $\\phi$ and show that the only solutions allowed are ones where $\\omega = \\sqrt{k/m}$ "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$$- A\\,m\\,{\\omega}^{2}\\,\\cos\\left(\\omega\\,t + \\varphi\\right) + A\\,k\\,\\cos\\left(\\omega\\,t + \\varphi\\right)$$"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(letfn [(proposed-solution [t]\n",
    "  (* 'A (cos (+ (* 'omega t) 'φ))))]\n",
    "  (tex (((Lagrange-equations (lg/L-harmonic 'm 'k)) proposed-solution) 't)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Exercise 1.11: Kepler's third law"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Show that a planet in circular orbit satisfies Kepler's third law $n^2a^3=G(M_1+m_2)$, where $n$ is the angular frequency of the orbit and $a$ is the distance between sun and planet. (Hint: use the reduced mass to construct the Lagrangian)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$$\\begin{bmatrix}\\frac{- M_1\\,{a}^{3}\\,m_2\\,{n}^{2} + G\\,{M_1}^{2}\\,m_2 + G\\,M_1\\,{m_2}^{2}}{M_1\\,{a}^{2} + {a}^{2}\\,m_2}&0\\end{bmatrix}$$"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(defn gravitational-energy [G M_1 m_2]\n",
    "  (fn [r]\n",
    "   (- (/ (* G M_1 m_2) r))))\n",
    "\n",
    "(defn circle [t]\n",
    "  (up 'a (* 'n t)))\n",
    "\n",
    "(let [lagrangian (lg/L-central-polar     \n",
    "                  (/ (* 'M_1 'm_2) (+ 'M_1 'm_2))     \n",
    "                  (gravitational-energy 'G 'M_1 'm_2))]\n",
    "      (tex (((Lagrange-equations lagrangian) circle) 't)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.6 How to find Lagrangians"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Central force field"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "State the dynamic equation of motion for the uniform acceleration and the central potential, the latter in rectangular as well as in polar coordinates."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$$\\begin{pmatrix}\\begin{bmatrix}m\\,{D}^{2}x\\left(t\\right)&g\\,m + m\\,{D}^{2}y\\left(t\\right)\\end{bmatrix}\\\\\\begin{bmatrix}\\frac{m\\,{D}^{2}x\\left(t\\right)\\,\\sqrt {{\\left(x\\left(t\\right)\\right)}^{2} + {\\left(y\\left(t\\right)\\right)}^{2}} + x\\left(t\\right)\\,DU\\left(\\sqrt {{\\left(x\\left(t\\right)\\right)}^{2} + {\\left(y\\left(t\\right)\\right)}^{2}}\\right)}{\\sqrt {{\\left(x\\left(t\\right)\\right)}^{2} + {\\left(y\\left(t\\right)\\right)}^{2}}}&\\frac{m\\,{D}^{2}y\\left(t\\right)\\,\\sqrt {{\\left(x\\left(t\\right)\\right)}^{2} + {\\left(y\\left(t\\right)\\right)}^{2}} + y\\left(t\\right)\\,DU\\left(\\sqrt {{\\left(x\\left(t\\right)\\right)}^{2} + {\\left(y\\left(t\\right)\\right)}^{2}}\\right)}{\\sqrt {{\\left(x\\left(t\\right)\\right)}^{2} + {\\left(y\\left(t\\right)\\right)}^{2}}}\\end{bmatrix}\\\\\\begin{bmatrix}- m\\,{\\left(D\\phi\\left(t\\right)\\right)}^{2}\\,r\\left(t\\right) + m\\,{D}^{2}r\\left(t\\right) + DU\\left(r\\left(t\\right)\\right)&2\\,m\\,D\\phi\\left(t\\right)\\,r\\left(t\\right)\\,Dr\\left(t\\right) + m\\,{\\left(r\\left(t\\right)\\right)}^{2}\\,{D}^{2}\\phi\\left(t\\right)\\end{bmatrix}\\end{pmatrix}$$"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(tex (up\n",
    "           (((Lagrange-equations\n",
    "              (lg/L-uniform-acceleration 'm 'g))\n",
    "            (up (literal-function 'x)\n",
    "              (literal-function 'y)))\n",
    "           't)\n",
    "           \n",
    "           (((Lagrange-equations\n",
    "              (lg/L-central-rectangular 'm (literal-function 'U)))\n",
    "            (up (literal-function 'x)\n",
    "              (literal-function 'y)))\n",
    "           't)\n",
    "           \n",
    "           (((Lagrange-equations\n",
    "              (lg/L-central-polar 'm (literal-function 'U)))\n",
    "            (up (literal-function 'r)\n",
    "              (literal-function 'phi)))\n",
    "           't)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.6.1 Coordinate transformations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Calculate the $[\\dot x \\space \\dot y]$ velocity vector in polar coordinates."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$$\\begin{pmatrix}- r\\,\\dot {\\varphi}\\,\\sin\\left(\\varphi\\right) + \\dot r\\,\\cos\\left(\\varphi\\right)\\\\r\\,\\dot {\\varphi}\\,\\cos\\left(\\varphi\\right) + \\dot r\\,\\sin\\left(\\varphi\\right)\\end{pmatrix}$$"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(tex (velocity ((F->C p->r) (->local 't (up 'r 'φ) (up 'rdot 'φdot)))))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Calculate the lagrangian in polar coordinates twice. Once directly and once via the lagrangian in rectangular coordinates."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$$\\begin{pmatrix}\\frac{1}{2}\\,m\\,{r}^{2}\\,{\\dot {\\varphi}}^{2} + \\frac{1}{2}\\,m\\,{\\dot r}^{2} - U\\left(r\\right)\\\\\\frac{1}{2}\\,m\\,{r}^{2}\\,{\\dot {\\varphi}}^{2} + \\frac{1}{2}\\,m\\,{\\dot r}^{2} - U\\left(r\\right)\\end{pmatrix}$$"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(defn L-alternate-central-polar\n",
    "  [m U]\n",
    "  (compose (lg/L-central-rectangular m U) (F->C p->r)))\n",
    "\n",
    "(tex\n",
    " (let [lcp ((lg/L-central-polar 'm (literal-function 'U))\n",
    "            (->local 't (up 'r 'φ) (up 'rdot 'φdot)))\n",
    "       lacp ((L-alternate-central-polar 'm (literal-function 'U))\n",
    "             (->local 't (up 'r 'φ) (up 'rdot 'φdot)))]\n",
    "   (up lcp lacp)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Coriolis and centrifugal forces"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "State, in cartesian coordinates, the Lagrangian for the two dimensional free particle in a rotating coordinate system."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$$\\frac{1}{2}\\,{\\Omega}^{2}\\,m\\,{x_r}^{2} + \\frac{1}{2}\\,{\\Omega}^{2}\\,m\\,{y_r}^{2} + \\Omega\\,m\\,x_r\\,{\\dot y}_r - \\Omega\\,m\\,{\\dot x}_r\\,y_r + \\frac{1}{2}\\,m\\,{{\\dot x}_r}^{2} + \\frac{1}{2}\\,m\\,{{\\dot y}_r}^{2}$$"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(def L-free-rectangular lg/L-free-particle)\n",
    "\n",
    "(defn L-free-polar [m]\n",
    " (compose (L-free-rectangular m) (F->C p->r)))\n",
    "\n",
    "(defn F [Omega]\n",
    " (fn [[t [r theta]]]\n",
    "  (up r (+ theta (* Omega t)))))\n",
    "\n",
    "(defn L-rotating-polar [m Omega]\n",
    " (compose (L-free-polar m) (F->C (F Omega))))\n",
    "\n",
    "(defn r->p\n",
    "  \"rectangular to polar coordinates of state.\"\n",
    "  [[_ [x y :as q]]]\n",
    "  (up (sqrt (square q)) (atan (/ y x))))\n",
    "\n",
    "(defn L-rotating-rectangular [m Omega]\n",
    "  (compose (L-rotating-polar m Omega) (F->C r->p)))\n",
    "\n",
    "(def L-simplify\n",
    "  (simplify ((L-rotating-rectangular 'm 'Omega)\n",
    "       \t(up 't (up 'x_r 'y_r) (up 'xdot_r 'ydot_r)))))\n",
    "\n",
    "(tex L-simplify)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Derive the equations of motion, in which the centrifugal and the coriolis force appear. (Hint: take the expression just obtained and use this data as code via Clojure's macro feature)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$$\\begin{bmatrix}- {\\Omega}^{2}\\,m\\,x_r\\left(t\\right) -2\\,\\Omega\\,m\\,Dy_r\\left(t\\right) + m\\,{D}^{2}x_r\\left(t\\right)&- {\\Omega}^{2}\\,m\\,y_r\\left(t\\right) + 2\\,\\Omega\\,m\\,Dx_r\\left(t\\right) + m\\,{D}^{2}y_r\\left(t\\right)\\end{bmatrix}$$"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(defmacro L-fn [args1 args2]\n",
    "  `(fn ~args1 (fn ~args2 ~L-simplify)))\n",
    "\n",
    "(def L-rotating-rectangular-simp (L-fn [m Omega] [[t [x_r y_r] [xdot_r ydot_r]]]))\n",
    "\n",
    "(tex\n",
    "  (((Lagrange-equations (L-rotating-rectangular-simp 'm 'Omega))\n",
    "     (up (literal-function 'x_r) (literal-function 'y_r)))\n",
    "     't))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Plot a clockwise rotating path. (Hints: (1) Use the SICM function \"Gamma\" to create the triple $(t \\: (x \\: y) \\: (\\dot{x} \\: \\dot{y}))$ which can be transformed, (2) the angular frequency must be negative) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<?xml version=\"1.0\"?>\n",
       "<svg height=\"600\" version=\"1.1\" width=\"985\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\"><g><g stroke-dasharray=\"1 1\" stroke=\"#caa\"><line x1=\"53.69\" x2=\"53.69\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"72.76\" x2=\"72.76\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"91.84\" x2=\"91.84\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"110.92\" x2=\"110.92\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"130.00\" x2=\"130.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"149.08\" x2=\"149.08\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"168.16\" x2=\"168.16\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"187.24\" x2=\"187.24\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"206.32\" x2=\"206.32\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"225.40\" x2=\"225.40\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"244.48\" x2=\"244.48\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"263.56\" x2=\"263.56\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"282.64\" x2=\"282.64\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"301.72\" x2=\"301.72\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"320.80\" x2=\"320.80\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"339.88\" x2=\"339.88\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"358.96\" x2=\"358.96\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"378.04\" x2=\"378.04\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"397.12\" x2=\"397.12\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"416.20\" x2=\"416.20\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"435.28\" x2=\"435.28\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"454.36\" x2=\"454.36\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"473.44\" x2=\"473.44\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"492.52\" x2=\"492.52\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"511.60\" x2=\"511.60\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"530.68\" x2=\"530.68\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"549.76\" x2=\"549.76\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"568.84\" x2=\"568.84\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"587.92\" x2=\"587.92\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"607.00\" x2=\"607.00\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"626.08\" x2=\"626.08\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"645.15\" x2=\"645.15\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"664.23\" x2=\"664.23\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"683.31\" x2=\"683.31\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"702.39\" x2=\"702.39\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"721.47\" x2=\"721.47\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"740.55\" x2=\"740.55\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"759.63\" x2=\"759.63\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"778.71\" x2=\"778.71\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"797.79\" x2=\"797.79\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"816.87\" x2=\"816.87\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"835.95\" x2=\"835.95\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"855.03\" x2=\"855.03\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"874.11\" x2=\"874.11\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"893.19\" x2=\"893.19\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"912.27\" x2=\"912.27\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"931.35\" x2=\"931.35\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"950.43\" x2=\"950.43\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"969.51\" x2=\"969.51\" y1=\"550.00\" y2=\"20.00\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"546.76\" y2=\"546.76\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"537.05\" y2=\"537.05\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"527.34\" y2=\"527.34\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"517.63\" y2=\"517.63\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"507.92\" y2=\"507.92\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"498.21\" y2=\"498.21\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"488.49\" y2=\"488.49\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"478.78\" y2=\"478.78\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"469.07\" y2=\"469.07\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"459.36\" y2=\"459.36\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"449.65\" y2=\"449.65\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"439.94\" y2=\"439.94\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"430.23\" y2=\"430.23\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"420.52\" y2=\"420.52\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"410.81\" y2=\"410.81\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"401.10\" y2=\"401.10\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"391.39\" y2=\"391.39\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"381.68\" y2=\"381.68\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"371.97\" y2=\"371.97\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"362.26\" y2=\"362.26\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"352.54\" y2=\"352.54\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"342.83\" y2=\"342.83\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"333.12\" y2=\"333.12\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"323.41\" y2=\"323.41\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"313.70\" y2=\"313.70\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"303.99\" y2=\"303.99\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"294.28\" y2=\"294.28\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"284.57\" y2=\"284.57\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"274.86\" y2=\"274.86\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"265.15\" y2=\"265.15\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"255.44\" y2=\"255.44\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"245.73\" y2=\"245.73\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"236.02\" y2=\"236.02\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"226.31\" y2=\"226.31\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"216.60\" y2=\"216.60\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"206.88\" y2=\"206.88\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"197.17\" y2=\"197.17\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"187.46\" y2=\"187.46\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"177.75\" y2=\"177.75\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"168.04\" y2=\"168.04\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"158.33\" y2=\"158.33\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"148.62\" y2=\"148.62\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"138.91\" y2=\"138.91\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"129.20\" y2=\"129.20\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"119.49\" y2=\"119.49\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"109.78\" y2=\"109.78\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"100.07\" y2=\"100.07\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"90.36\" y2=\"90.36\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"80.65\" y2=\"80.65\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"70.93\" y2=\"70.93\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"61.22\" y2=\"61.22\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"51.51\" y2=\"51.51\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"41.80\" y2=\"41.80\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"32.09\" y2=\"32.09\" /><line x1=\"50.00\" x2=\"975.00\" y1=\"22.38\" y2=\"22.38\" /></g><g stroke-width=\"2pt\" stroke=\"#f60\"><circle cx=\"50.00\" cy=\"230.35\" r=\"3\" /><circle cx=\"50.52\" cy=\"248.79\" r=\"3\" /><circle cx=\"52.75\" cy=\"211.81\" r=\"3\" /><circle cx=\"54.26\" cy=\"266.98\" r=\"3\" /><circle cx=\"58.80\" cy=\"193.32\" r=\"3\" /><circle cx=\"61.12\" cy=\"284.79\" r=\"3\" /><circle cx=\"68.15\" cy=\"175.04\" r=\"3\" /><circle cx=\"71.02\" cy=\"302.06\" r=\"3\" /><circle cx=\"80.78\" cy=\"157.12\" r=\"3\" /><circle cx=\"83.80\" cy=\"318.68\" r=\"3\" /><circle cx=\"96.64\" cy=\"139.71\" r=\"3\" /><circle cx=\"99.34\" cy=\"334.51\" r=\"3\" /><circle cx=\"115.65\" cy=\"122.96\" r=\"3\" /><circle cx=\"117.44\" cy=\"349.44\" r=\"3\" /><circle cx=\"137.69\" cy=\"107.02\" r=\"3\" /><circle cx=\"137.93\" cy=\"363.37\" r=\"3\" /><circle cx=\"160.59\" cy=\"376.19\" r=\"3\" /><circle cx=\"162.64\" cy=\"92.04\" r=\"3\" /><circle cx=\"185.21\" cy=\"387.83\" r=\"3\" /><circle cx=\"190.33\" cy=\"78.15\" r=\"3\" /><circle cx=\"211.54\" cy=\"398.21\" r=\"3\" /><circle cx=\"220.58\" cy=\"65.48\" r=\"3\" /><circle cx=\"239.35\" cy=\"407.26\" r=\"3\" /><circle cx=\"253.18\" cy=\"54.16\" r=\"3\" /><circle cx=\"268.38\" cy=\"414.93\" r=\"3\" /><circle cx=\"287.90\" cy=\"44.30\" r=\"3\" /><circle cx=\"298.38\" cy=\"421.19\" r=\"3\" /><circle cx=\"324.48\" cy=\"35.99\" r=\"3\" /><circle cx=\"329.08\" cy=\"426.01\" r=\"3\" /><circle cx=\"360.22\" cy=\"429.38\" r=\"3\" /><circle cx=\"362.65\" cy=\"29.34\" r=\"3\" /><circle cx=\"380.65\" cy=\"549.51\" r=\"3\" /><circle cx=\"391.54\" cy=\"431.29\" r=\"3\" /><circle cx=\"402.12\" cy=\"24.41\" r=\"3\" /><circle cx=\"422.78\" cy=\"431.76\" r=\"3\" /><circle cx=\"432.45\" cy=\"550.00\" r=\"3\" /><circle cx=\"442.59\" cy=\"21.28\" r=\"3\" /><circle cx=\"453.68\" cy=\"430.81\" r=\"3\" /><circle cx=\"483.74\" cy=\"20.00\" r=\"3\" /><circle cx=\"483.84\" cy=\"548.14\" r=\"3\" /><circle cx=\"483.99\" cy=\"428.47\" r=\"3\" /><circle cx=\"513.49\" cy=\"424.80\" r=\"3\" /><circle cx=\"525.25\" cy=\"20.60\" r=\"3\" /><circle cx=\"534.40\" cy=\"543.99\" r=\"3\" /><circle cx=\"541.94\" cy=\"419.83\" r=\"3\" /><circle cx=\"566.77\" cy=\"23.10\" r=\"3\" /><circle cx=\"569.13\" cy=\"413.65\" r=\"3\" /><circle cx=\"583.75\" cy=\"537.58\" r=\"3\" /><circle cx=\"587.92\" cy=\"148.62\" r=\"3\" /><circle cx=\"594.86\" cy=\"406.31\" r=\"3\" /><circle cx=\"607.98\" cy=\"27.52\" r=\"3\" /><circle cx=\"608.01\" cy=\"153.73\" r=\"3\" /><circle cx=\"618.96\" cy=\"397.92\" r=\"3\" /><circle cx=\"627.36\" cy=\"159.83\" r=\"3\" /><circle cx=\"631.50\" cy=\"529.01\" r=\"3\" /><circle cx=\"641.24\" cy=\"388.55\" r=\"3\" /><circle cx=\"645.78\" cy=\"166.88\" r=\"3\" /><circle cx=\"648.53\" cy=\"33.84\" r=\"3\" /><circle cx=\"661.57\" cy=\"378.31\" r=\"3\" /><circle cx=\"663.08\" cy=\"174.85\" r=\"3\" /><circle cx=\"677.28\" cy=\"518.37\" r=\"3\" /><circle cx=\"679.10\" cy=\"183.70\" r=\"3\" /><circle cx=\"679.82\" cy=\"367.28\" r=\"3\" /><circle cx=\"688.07\" cy=\"42.03\" r=\"3\" /><circle cx=\"693.66\" cy=\"193.36\" r=\"3\" /><circle cx=\"695.87\" cy=\"355.59\" r=\"3\" /><circle cx=\"706.60\" cy=\"203.78\" r=\"3\" /><circle cx=\"709.65\" cy=\"343.35\" r=\"3\" /><circle cx=\"717.77\" cy=\"214.89\" r=\"3\" /><circle cx=\"720.76\" cy=\"505.76\" r=\"3\" /><circle cx=\"721.09\" cy=\"330.65\" r=\"3\" /><circle cx=\"726.28\" cy=\"52.06\" r=\"3\" /><circle cx=\"727.03\" cy=\"226.60\" r=\"3\" /><circle cx=\"730.13\" cy=\"317.62\" r=\"3\" /><circle cx=\"734.27\" cy=\"238.83\" r=\"3\" /><circle cx=\"736.76\" cy=\"304.38\" r=\"3\" /><circle cx=\"739.36\" cy=\"251.49\" r=\"3\" /><circle cx=\"740.97\" cy=\"291.03\" r=\"3\" /><circle cx=\"742.22\" cy=\"264.48\" r=\"3\" /><circle cx=\"742.78\" cy=\"277.69\" r=\"3\" /><circle cx=\"761.62\" cy=\"491.31\" r=\"3\" /><circle cx=\"762.82\" cy=\"63.87\" r=\"3\" /><circle cx=\"797.38\" cy=\"77.38\" r=\"3\" /><circle cx=\"799.55\" cy=\"475.15\" r=\"3\" /><circle cx=\"829.64\" cy=\"92.51\" r=\"3\" /><circle cx=\"834.28\" cy=\"457.45\" r=\"3\" /><circle cx=\"859.30\" cy=\"109.17\" r=\"3\" /><circle cx=\"865.58\" cy=\"438.35\" r=\"3\" /><circle cx=\"886.11\" cy=\"127.22\" r=\"3\" /><circle cx=\"893.24\" cy=\"418.02\" r=\"3\" /><circle cx=\"909.78\" cy=\"146.55\" r=\"3\" /><circle cx=\"917.07\" cy=\"396.65\" r=\"3\" /><circle cx=\"930.10\" cy=\"167.01\" r=\"3\" /><circle cx=\"936.93\" cy=\"374.42\" r=\"3\" /><circle cx=\"946.86\" cy=\"188.46\" r=\"3\" /><circle cx=\"952.72\" cy=\"351.51\" r=\"3\" /><circle cx=\"959.87\" cy=\"210.72\" r=\"3\" /><circle cx=\"964.35\" cy=\"328.13\" r=\"3\" /><circle cx=\"968.97\" cy=\"233.63\" r=\"3\" /><circle cx=\"971.78\" cy=\"304.45\" r=\"3\" /><circle cx=\"974.04\" cy=\"257.01\" r=\"3\" /><circle cx=\"975.00\" cy=\"280.69\" r=\"3\" /></g><g stroke=\"black\"><line x1=\"53.69\" x2=\"53.69\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"72.76\" x2=\"72.76\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"91.84\" x2=\"91.84\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"110.92\" x2=\"110.92\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"130.00\" x2=\"130.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"149.08\" x2=\"149.08\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"168.16\" x2=\"168.16\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"187.24\" x2=\"187.24\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"206.32\" x2=\"206.32\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"225.40\" x2=\"225.40\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"244.48\" x2=\"244.48\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"263.56\" x2=\"263.56\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"282.64\" x2=\"282.64\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"301.72\" x2=\"301.72\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"320.80\" x2=\"320.80\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"339.88\" x2=\"339.88\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"358.96\" x2=\"358.96\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"378.04\" x2=\"378.04\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"397.12\" x2=\"397.12\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"416.20\" x2=\"416.20\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"435.28\" x2=\"435.28\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"454.36\" x2=\"454.36\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"473.44\" x2=\"473.44\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"492.52\" x2=\"492.52\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"511.60\" x2=\"511.60\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"530.68\" x2=\"530.68\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"549.76\" x2=\"549.76\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"568.84\" x2=\"568.84\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"587.92\" x2=\"587.92\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"607.00\" x2=\"607.00\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"626.08\" x2=\"626.08\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"645.15\" x2=\"645.15\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"664.23\" x2=\"664.23\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"683.31\" x2=\"683.31\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"702.39\" x2=\"702.39\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"721.47\" x2=\"721.47\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"740.55\" x2=\"740.55\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"759.63\" x2=\"759.63\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"778.71\" x2=\"778.71\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"797.79\" x2=\"797.79\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"816.87\" x2=\"816.87\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"835.95\" x2=\"835.95\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"855.03\" x2=\"855.03\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"874.11\" x2=\"874.11\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"893.19\" x2=\"893.19\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"912.27\" x2=\"912.27\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"931.35\" x2=\"931.35\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"950.43\" x2=\"950.43\" y1=\"550.00\" y2=\"560.00\" /><line x1=\"969.51\" x2=\"969.51\" y1=\"550.00\" y2=\"560.00\" /><g fill=\"black\" font-family=\"Arial, sans-serif\" font-size=\"10\" stroke=\"none\" text-anchor=\"middle\"><text x=\"53.69\" y=\"570.00\">-21.00</text><text x=\"72.76\" y=\"570.00\">-20.00</text><text x=\"91.84\" y=\"570.00\">-19.00</text><text x=\"110.92\" y=\"570.00\">-18.00</text><text x=\"130.00\" y=\"570.00\">-17.00</text><text x=\"149.08\" y=\"570.00\">-16.00</text><text x=\"168.16\" y=\"570.00\">-15.00</text><text x=\"187.24\" y=\"570.00\">-14.00</text><text x=\"206.32\" y=\"570.00\">-13.00</text><text x=\"225.40\" y=\"570.00\">-12.00</text><text x=\"244.48\" y=\"570.00\">-11.00</text><text x=\"263.56\" y=\"570.00\">-10.00</text><text x=\"282.64\" y=\"570.00\">-9.00</text><text x=\"301.72\" y=\"570.00\">-8.00</text><text x=\"320.80\" y=\"570.00\">-7.00</text><text x=\"339.88\" y=\"570.00\">-6.00</text><text x=\"358.96\" y=\"570.00\">-5.00</text><text x=\"378.04\" y=\"570.00\">-4.00</text><text x=\"397.12\" y=\"570.00\">-3.00</text><text x=\"416.20\" y=\"570.00\">-2.00</text><text x=\"435.28\" y=\"570.00\">-1.00</text><text x=\"454.36\" y=\"570.00\">0.00</text><text x=\"473.44\" y=\"570.00\">1.00</text><text x=\"492.52\" y=\"570.00\">2.00</text><text x=\"511.60\" y=\"570.00\">3.00</text><text x=\"530.68\" y=\"570.00\">4.00</text><text x=\"549.76\" y=\"570.00\">5.00</text><text x=\"568.84\" y=\"570.00\">6.00</text><text x=\"587.92\" y=\"570.00\">7.00</text><text x=\"607.00\" y=\"570.00\">8.00</text><text x=\"626.08\" y=\"570.00\">9.00</text><text x=\"645.15\" y=\"570.00\">10.00</text><text x=\"664.23\" y=\"570.00\">11.00</text><text x=\"683.31\" y=\"570.00\">12.00</text><text x=\"702.39\" y=\"570.00\">13.00</text><text x=\"721.47\" y=\"570.00\">14.00</text><text x=\"740.55\" y=\"570.00\">15.00</text><text x=\"759.63\" y=\"570.00\">16.00</text><text x=\"778.71\" y=\"570.00\">17.00</text><text x=\"797.79\" y=\"570.00\">18.00</text><text x=\"816.87\" y=\"570.00\">19.00</text><text x=\"835.95\" y=\"570.00\">20.00</text><text x=\"855.03\" y=\"570.00\">21.00</text><text x=\"874.11\" y=\"570.00\">22.00</text><text x=\"893.19\" y=\"570.00\">23.00</text><text x=\"912.27\" y=\"570.00\">24.00</text><text x=\"931.35\" y=\"570.00\">25.00</text><text x=\"950.43\" y=\"570.00\">26.00</text><text x=\"969.51\" y=\"570.00\">27.00</text></g><line x1=\"50.00\" x2=\"975.00\" y1=\"550.00\" y2=\"550.00\" /></g><g stroke=\"black\"><line x1=\"50.00\" x2=\"40.00\" y1=\"546.76\" y2=\"546.76\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"537.05\" y2=\"537.05\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"527.34\" y2=\"527.34\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"517.63\" y2=\"517.63\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"507.92\" y2=\"507.92\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"498.21\" y2=\"498.21\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"488.49\" y2=\"488.49\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"478.78\" y2=\"478.78\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"469.07\" y2=\"469.07\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"459.36\" y2=\"459.36\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"449.65\" y2=\"449.65\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"439.94\" y2=\"439.94\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"430.23\" y2=\"430.23\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"420.52\" y2=\"420.52\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"410.81\" y2=\"410.81\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"401.10\" y2=\"401.10\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"391.39\" y2=\"391.39\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"381.68\" y2=\"381.68\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"371.97\" y2=\"371.97\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"362.26\" y2=\"362.26\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"352.54\" y2=\"352.54\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"342.83\" y2=\"342.83\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"333.12\" y2=\"333.12\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"323.41\" y2=\"323.41\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"313.70\" y2=\"313.70\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"303.99\" y2=\"303.99\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"294.28\" y2=\"294.28\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"284.57\" y2=\"284.57\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"274.86\" y2=\"274.86\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"265.15\" y2=\"265.15\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"255.44\" y2=\"255.44\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"245.73\" y2=\"245.73\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"236.02\" y2=\"236.02\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"226.31\" y2=\"226.31\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"216.60\" y2=\"216.60\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"206.88\" y2=\"206.88\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"197.17\" y2=\"197.17\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"187.46\" y2=\"187.46\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"177.75\" y2=\"177.75\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"168.04\" y2=\"168.04\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"158.33\" y2=\"158.33\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"148.62\" y2=\"148.62\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"138.91\" y2=\"138.91\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"129.20\" y2=\"129.20\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"119.49\" y2=\"119.49\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"109.78\" y2=\"109.78\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"100.07\" y2=\"100.07\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"90.36\" y2=\"90.36\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"80.65\" y2=\"80.65\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"70.93\" y2=\"70.93\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"61.22\" y2=\"61.22\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"51.51\" y2=\"51.51\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"41.80\" y2=\"41.80\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"32.09\" y2=\"32.09\" /><line x1=\"50.00\" x2=\"40.00\" y1=\"22.38\" y2=\"22.38\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"548.70\" y2=\"548.70\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"546.76\" y2=\"546.76\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"544.82\" y2=\"544.82\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"542.87\" y2=\"542.87\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"540.93\" y2=\"540.93\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"538.99\" y2=\"538.99\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"537.05\" y2=\"537.05\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"535.11\" y2=\"535.11\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"533.16\" y2=\"533.16\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"531.22\" y2=\"531.22\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"529.28\" y2=\"529.28\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"527.34\" y2=\"527.34\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"525.40\" y2=\"525.40\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"523.45\" y2=\"523.45\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"521.51\" y2=\"521.51\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"519.57\" y2=\"519.57\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"517.63\" y2=\"517.63\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"515.68\" y2=\"515.68\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"513.74\" y2=\"513.74\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"511.80\" y2=\"511.80\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"509.86\" y2=\"509.86\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"507.92\" y2=\"507.92\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"505.97\" y2=\"505.97\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"504.03\" y2=\"504.03\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"502.09\" y2=\"502.09\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"500.15\" y2=\"500.15\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"498.21\" y2=\"498.21\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"496.26\" y2=\"496.26\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"494.32\" y2=\"494.32\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"492.38\" y2=\"492.38\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"490.44\" y2=\"490.44\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"488.49\" y2=\"488.49\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"486.55\" y2=\"486.55\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"484.61\" y2=\"484.61\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"482.67\" y2=\"482.67\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"480.73\" y2=\"480.73\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"478.78\" y2=\"478.78\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"476.84\" y2=\"476.84\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"474.90\" y2=\"474.90\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"472.96\" y2=\"472.96\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"471.02\" y2=\"471.02\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"469.07\" y2=\"469.07\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"467.13\" y2=\"467.13\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"465.19\" y2=\"465.19\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"463.25\" y2=\"463.25\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"461.30\" y2=\"461.30\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"459.36\" y2=\"459.36\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"457.42\" y2=\"457.42\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"455.48\" y2=\"455.48\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"453.54\" y2=\"453.54\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"451.59\" y2=\"451.59\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"449.65\" y2=\"449.65\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"447.71\" y2=\"447.71\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"445.77\" y2=\"445.77\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"443.83\" y2=\"443.83\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"441.88\" y2=\"441.88\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"439.94\" y2=\"439.94\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"438.00\" y2=\"438.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"436.06\" y2=\"436.06\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"434.11\" y2=\"434.11\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"432.17\" y2=\"432.17\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"430.23\" y2=\"430.23\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"428.29\" y2=\"428.29\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"426.35\" y2=\"426.35\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"424.40\" y2=\"424.40\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"422.46\" y2=\"422.46\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"420.52\" y2=\"420.52\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"418.58\" y2=\"418.58\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"416.64\" y2=\"416.64\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"414.69\" y2=\"414.69\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"412.75\" y2=\"412.75\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"410.81\" y2=\"410.81\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"408.87\" y2=\"408.87\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"406.92\" y2=\"406.92\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"404.98\" y2=\"404.98\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"403.04\" y2=\"403.04\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"401.10\" y2=\"401.10\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"399.16\" y2=\"399.16\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"397.21\" y2=\"397.21\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"395.27\" y2=\"395.27\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"393.33\" y2=\"393.33\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"391.39\" y2=\"391.39\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"389.45\" y2=\"389.45\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"387.50\" y2=\"387.50\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"385.56\" y2=\"385.56\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"383.62\" y2=\"383.62\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"381.68\" y2=\"381.68\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"379.73\" y2=\"379.73\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"377.79\" y2=\"377.79\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"375.85\" y2=\"375.85\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"373.91\" y2=\"373.91\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"371.97\" y2=\"371.97\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"370.02\" y2=\"370.02\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"368.08\" y2=\"368.08\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"366.14\" y2=\"366.14\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"364.20\" y2=\"364.20\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"362.26\" y2=\"362.26\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"360.31\" y2=\"360.31\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"358.37\" y2=\"358.37\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"356.43\" y2=\"356.43\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"354.49\" y2=\"354.49\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"352.54\" y2=\"352.54\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"350.60\" y2=\"350.60\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"348.66\" y2=\"348.66\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"346.72\" y2=\"346.72\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"344.78\" y2=\"344.78\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"342.83\" y2=\"342.83\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"340.89\" y2=\"340.89\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"338.95\" y2=\"338.95\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"337.01\" y2=\"337.01\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"335.07\" y2=\"335.07\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"333.12\" y2=\"333.12\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"331.18\" y2=\"331.18\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"329.24\" y2=\"329.24\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"327.30\" y2=\"327.30\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"325.36\" y2=\"325.36\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"323.41\" y2=\"323.41\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"321.47\" y2=\"321.47\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"319.53\" y2=\"319.53\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"317.59\" y2=\"317.59\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"315.64\" y2=\"315.64\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"313.70\" y2=\"313.70\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"311.76\" y2=\"311.76\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"309.82\" y2=\"309.82\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"307.88\" y2=\"307.88\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"305.93\" y2=\"305.93\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"303.99\" y2=\"303.99\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"302.05\" y2=\"302.05\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"300.11\" y2=\"300.11\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"298.17\" y2=\"298.17\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"296.22\" y2=\"296.22\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"294.28\" y2=\"294.28\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"292.34\" y2=\"292.34\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"290.40\" y2=\"290.40\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"288.45\" y2=\"288.45\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"286.51\" y2=\"286.51\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"284.57\" y2=\"284.57\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"282.63\" y2=\"282.63\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"280.69\" y2=\"280.69\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"278.74\" y2=\"278.74\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"276.80\" y2=\"276.80\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"274.86\" y2=\"274.86\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"272.92\" y2=\"272.92\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"270.98\" y2=\"270.98\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"269.03\" y2=\"269.03\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"267.09\" y2=\"267.09\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"265.15\" y2=\"265.15\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"263.21\" y2=\"263.21\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"261.26\" y2=\"261.26\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"259.32\" y2=\"259.32\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"257.38\" y2=\"257.38\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"255.44\" y2=\"255.44\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"253.50\" y2=\"253.50\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"251.55\" y2=\"251.55\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"249.61\" y2=\"249.61\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"247.67\" y2=\"247.67\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"245.73\" y2=\"245.73\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"243.79\" y2=\"243.79\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"241.84\" y2=\"241.84\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"239.90\" y2=\"239.90\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"237.96\" y2=\"237.96\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"236.02\" y2=\"236.02\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"234.07\" y2=\"234.07\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"232.13\" y2=\"232.13\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"230.19\" y2=\"230.19\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"228.25\" y2=\"228.25\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"226.31\" y2=\"226.31\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"224.36\" y2=\"224.36\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"222.42\" y2=\"222.42\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"220.48\" y2=\"220.48\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"218.54\" y2=\"218.54\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"216.60\" y2=\"216.60\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"214.65\" y2=\"214.65\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"212.71\" y2=\"212.71\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"210.77\" y2=\"210.77\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"208.83\" y2=\"208.83\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"206.88\" y2=\"206.88\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"204.94\" y2=\"204.94\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"203.00\" y2=\"203.00\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"201.06\" y2=\"201.06\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"199.12\" y2=\"199.12\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"197.17\" y2=\"197.17\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"195.23\" y2=\"195.23\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"193.29\" y2=\"193.29\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"191.35\" y2=\"191.35\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"189.41\" y2=\"189.41\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"187.46\" y2=\"187.46\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"185.52\" y2=\"185.52\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"183.58\" y2=\"183.58\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"181.64\" y2=\"181.64\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"179.69\" y2=\"179.69\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"177.75\" y2=\"177.75\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"175.81\" y2=\"175.81\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"173.87\" y2=\"173.87\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"171.93\" y2=\"171.93\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"169.98\" y2=\"169.98\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"168.04\" y2=\"168.04\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"166.10\" y2=\"166.10\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"164.16\" y2=\"164.16\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"162.22\" y2=\"162.22\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"160.27\" y2=\"160.27\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"158.33\" y2=\"158.33\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"156.39\" y2=\"156.39\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"154.45\" y2=\"154.45\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"152.50\" y2=\"152.50\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"150.56\" y2=\"150.56\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"148.62\" y2=\"148.62\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"146.68\" y2=\"146.68\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"144.74\" y2=\"144.74\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"142.79\" y2=\"142.79\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"140.85\" y2=\"140.85\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"138.91\" y2=\"138.91\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"136.97\" y2=\"136.97\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"135.03\" y2=\"135.03\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"133.08\" y2=\"133.08\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"131.14\" y2=\"131.14\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"129.20\" y2=\"129.20\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"127.26\" y2=\"127.26\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"125.31\" y2=\"125.31\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"123.37\" y2=\"123.37\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"121.43\" y2=\"121.43\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"119.49\" y2=\"119.49\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"117.55\" y2=\"117.55\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"115.60\" y2=\"115.60\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"113.66\" y2=\"113.66\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"111.72\" y2=\"111.72\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"109.78\" y2=\"109.78\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"107.84\" y2=\"107.84\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"105.89\" y2=\"105.89\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"103.95\" y2=\"103.95\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"102.01\" y2=\"102.01\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"100.07\" y2=\"100.07\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"98.12\" y2=\"98.12\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"96.18\" y2=\"96.18\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"94.24\" y2=\"94.24\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"92.30\" y2=\"92.30\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"90.36\" y2=\"90.36\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"88.41\" y2=\"88.41\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"86.47\" y2=\"86.47\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"84.53\" y2=\"84.53\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"82.59\" y2=\"82.59\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"80.65\" y2=\"80.65\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"78.70\" y2=\"78.70\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"76.76\" y2=\"76.76\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"74.82\" y2=\"74.82\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"72.88\" y2=\"72.88\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"70.93\" y2=\"70.93\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"68.99\" y2=\"68.99\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"67.05\" y2=\"67.05\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"65.11\" y2=\"65.11\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"63.17\" y2=\"63.17\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"61.22\" y2=\"61.22\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"59.28\" y2=\"59.28\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"57.34\" y2=\"57.34\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"55.40\" y2=\"55.40\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"53.46\" y2=\"53.46\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"51.51\" y2=\"51.51\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"49.57\" y2=\"49.57\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"47.63\" y2=\"47.63\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"45.69\" y2=\"45.69\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"43.74\" y2=\"43.74\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"41.80\" y2=\"41.80\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"39.86\" y2=\"39.86\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"37.92\" y2=\"37.92\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"35.98\" y2=\"35.98\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"34.03\" y2=\"34.03\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"32.09\" y2=\"32.09\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"30.15\" y2=\"30.15\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"28.21\" y2=\"28.21\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"26.27\" y2=\"26.27\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"24.32\" y2=\"24.32\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"22.38\" y2=\"22.38\" /><line x1=\"50.00\" x2=\"45.00\" y1=\"20.44\" y2=\"20.44\" /><g fill=\"black\" font-family=\"Arial, sans-serif\" font-size=\"10\" stroke=\"none\" text-anchor=\"end\"><text x=\"35.00\" y=\"546.76\">-30.00</text><text x=\"35.00\" y=\"537.05\">-29.00</text><text x=\"35.00\" y=\"527.34\">-28.00</text><text x=\"35.00\" y=\"517.63\">-27.00</text><text x=\"35.00\" y=\"507.92\">-26.00</text><text x=\"35.00\" y=\"498.21\">-25.00</text><text x=\"35.00\" y=\"488.49\">-24.00</text><text x=\"35.00\" y=\"478.78\">-23.00</text><text x=\"35.00\" y=\"469.07\">-22.00</text><text x=\"35.00\" y=\"459.36\">-21.00</text><text x=\"35.00\" y=\"449.65\">-20.00</text><text x=\"35.00\" y=\"439.94\">-19.00</text><text x=\"35.00\" y=\"430.23\">-18.00</text><text x=\"35.00\" y=\"420.52\">-17.00</text><text x=\"35.00\" y=\"410.81\">-16.00</text><text x=\"35.00\" y=\"401.10\">-15.00</text><text x=\"35.00\" y=\"391.39\">-14.00</text><text x=\"35.00\" y=\"381.68\">-13.00</text><text x=\"35.00\" y=\"371.97\">-12.00</text><text x=\"35.00\" y=\"362.26\">-11.00</text><text x=\"35.00\" y=\"352.54\">-10.00</text><text x=\"35.00\" y=\"342.83\">-9.00</text><text x=\"35.00\" y=\"333.12\">-8.00</text><text x=\"35.00\" y=\"323.41\">-7.00</text><text x=\"35.00\" y=\"313.70\">-6.00</text><text x=\"35.00\" y=\"303.99\">-5.00</text><text x=\"35.00\" y=\"294.28\">-4.00</text><text x=\"35.00\" y=\"284.57\">-3.00</text><text x=\"35.00\" y=\"274.86\">-2.00</text><text x=\"35.00\" y=\"265.15\">-1.00</text><text x=\"35.00\" y=\"255.44\">0.00</text><text x=\"35.00\" y=\"245.73\">1.00</text><text x=\"35.00\" y=\"236.02\">2.00</text><text x=\"35.00\" y=\"226.31\">3.00</text><text x=\"35.00\" y=\"216.60\">4.00</text><text x=\"35.00\" y=\"206.88\">5.00</text><text x=\"35.00\" y=\"197.17\">6.00</text><text x=\"35.00\" y=\"187.46\">7.00</text><text x=\"35.00\" y=\"177.75\">8.00</text><text x=\"35.00\" y=\"168.04\">9.00</text><text x=\"35.00\" y=\"158.33\">10.00</text><text x=\"35.00\" y=\"148.62\">11.00</text><text x=\"35.00\" y=\"138.91\">12.00</text><text x=\"35.00\" y=\"129.20\">13.00</text><text x=\"35.00\" y=\"119.49\">14.00</text><text x=\"35.00\" y=\"109.78\">15.00</text><text x=\"35.00\" y=\"100.07\">16.00</text><text x=\"35.00\" y=\"90.36\">17.00</text><text x=\"35.00\" y=\"80.65\">18.00</text><text x=\"35.00\" y=\"70.93\">19.00</text><text x=\"35.00\" y=\"61.22\">20.00</text><text x=\"35.00\" y=\"51.51\">21.00</text><text x=\"35.00\" y=\"41.80\">22.00</text><text x=\"35.00\" y=\"32.09\">23.00</text><text x=\"35.00\" y=\"22.38\">24.00</text></g><line x1=\"50.00\" x2=\"50.00\" y1=\"550.00\" y2=\"20.00\" /></g></g></svg>"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(defn test-path-2d\n",
    "  [t]\n",
    "  (up\n",
    "   (+ (* 3 t) 7)\n",
    "   (+ (* 5 t) 11)))\n",
    "\n",
    "(defn rotate-path [path-fn]\n",
    "(simplify\n",
    " ((F->C p->r)\n",
    "  ((F->C (F 'Omega))\n",
    "   ((F->C r->p)\n",
    "    ((Gamma path-fn) 't))))))\n",
    "\n",
    "(def xy (nth (rotate-path test-path-2d) 2))\n",
    "(def x (nth xy 1))\n",
    "(def y (nth xy 2))\n",
    "\n",
    "(defmacro P-fn [args1 args2]\n",
    "  `(fn ~args1 (up (fn ~args2 ~x) (fn ~args2 ~y))))\n",
    "\n",
    "(def rotating-path-2d (P-fn [Omega] [t]))\n",
    "\n",
    "(let [NegativeOm -3]\n",
    "    (->\n",
    "        (points-xy->plot {orange (make-path-txyz (rotating-path-2d NegativeOm) 0 3 100)})\n",
    "        export-viz\n",
    "        display/make-html))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Show that this path indeed satiesfies the equations of motion in a rotating coordinate system."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\begin{bmatrix}0&0\\end{bmatrix}$"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(tex\n",
    "   (let [Om 'Omega\n",
    "         NegativeOm (* -1 Om)]\n",
    "     (((Lagrange-equations (L-rotating-rectangular-simp 'm Om))\n",
    "       (rotating-path-2d NegativeOm))\n",
    "      't)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.6.2 Systems with rigid constraints"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### A pendulum driven at the pivot"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "State Lagrange’s equation for this system."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$g\\,l\\,m\\,\\sin\\left(\\theta\\left(t\\right)\\right) + {l}^{2}\\,m\\,{D}^{2}\\theta\\left(t\\right) + l\\,m\\,{D}^{2}y_s\\left(t\\right)\\,\\sin\\left(\\theta\\left(t\\right)\\right)$"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(defn T-pend\n",
    "  [m l _ ys]\n",
    "  (fn [local]\n",
    "    (let [[t theta thetadot] local\n",
    "          vys (D ys)]\n",
    "      (* 1/2 m\n",
    "         (+ (square (* l thetadot))\n",
    "            (square (vys t))\n",
    "            (* 2 l (vys t) thetadot (sin theta)))))))\n",
    "\n",
    "(defn V-pend\n",
    "  [m l g ys]\n",
    "  (fn [local]\n",
    "    (let [[t theta _] local]\n",
    "      (* m g (- (ys t) (* l (cos theta)))))))\n",
    "\n",
    "(def L-pend (- T-pend V-pend))\n",
    "\n",
    "(def θ (literal-function 'θ))\n",
    "(def y_s (literal-function 'y_s))\n",
    "\n",
    "(tex\n",
    "  (((Lagrange-equations (L-pend 'm 'l 'g y_s)) θ) 't))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "State the Lagrangian"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\frac{1}{2}\\,{l}^{2}\\,m\\,{\\dot {\\theta}}^{2} + l\\,m\\,\\dot {\\theta}\\,Dy_s\\left(t\\right)\\,\\sin\\left(\\theta\\right) + g\\,l\\,m\\,\\cos\\left(\\theta\\right) - g\\,m\\,y_s\\left(t\\right) + \\frac{1}{2}\\,m\\,{\\left(Dy_s\\left(t\\right)\\right)}^{2}$"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(tex\n",
    "  ((L-pend 'm 'l 'g y_s) (->local 't 'θ 'θdot)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.6.3 Constraints as Coordinate Transformations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Derive the previous result by using coordinate transformations."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\frac{1}{2}\\,{l}^{2}\\,m\\,{\\dot {\\theta}}^{2} + l\\,m\\,\\dot {\\theta}\\,Dy_s\\left(t\\right)\\,\\sin\\left(\\theta\\right) + g\\,l\\,m\\,\\cos\\left(\\theta\\right) - g\\,m\\,y_s\\left(t\\right) + \\frac{1}{2}\\,m\\,{\\left(Dy_s\\left(t\\right)\\right)}^{2}$"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(defn L-uniform-acceleration [m g]\n",
    "  (fn [[_ [_ y] v]]\n",
    "    (- (* 1/2 m (square v)) (* m g y))))\n",
    "\n",
    "(defn dp-coordinates [l y_s]\n",
    "  (fn [[t θ]]\n",
    "    (let [x (* l (sin θ))\n",
    "          y (- (y_s t) (* l (cos θ)))]\n",
    "      (up x y))))\n",
    "\n",
    "(defn L-pend2 [m l g y_s]\n",
    "  (comp (L-uniform-acceleration m g)\n",
    "        (F->C (dp-coordinates l y_s))))\n",
    "(tex\n",
    "        ((L-pend2 'm 'l 'g y_s) (->local 't 'θ 'θdot)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1.8.3 Central Forces in Three Dimensions"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Calculate the z-component of the angular momentum of an arbitrary path in rectangular and spherical coordinates."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\begin{pmatrix}m\\,x\\,\\dot y - m\\,\\dot x\\,y\\\\m\\,{r}^{2}\\,\\dot {\\varphi}\\,{\\sin}^{2}\\left(\\theta\\right)\\end{pmatrix}$"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(def rectangular-state (up 't\n",
    "                           (up 'x 'y 'z)\n",
    "                           (up 'xdot 'ydot 'zdot)))\n",
    "\n",
    "(def spherical-state (up 't\n",
    "                         (up 'r 'θ 'φ)\n",
    "                         (up 'rdot 'θdot 'φdot)))\n",
    "\n",
    "(defn ang-mom-z [m]\n",
    "  (fn [[_ xyz v]]\n",
    "    (get (cross-product xyz (* m v)) 2)))\n",
    "\n",
    "(tex\n",
    "  (up\n",
    "    ((ang-mom-z 'm) rectangular-state)\n",
    "    ((compose (ang-mom-z 'm) (F->C s->r)) spherical-state)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Using sherical coordinates, calculate the generalized forces and the generalized momenta of a planet moving in a central potential. Thus show that the momentum conjugate to the third coordinate $\\phi$ is (1) conserved (because the respective force is zero) and (2) identical the z-component of the angular momentum."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\begin{pmatrix}\\begin{bmatrix}m\\,r\\,{\\dot {\\varphi}}^{2}\\,{\\sin}^{2}\\left(\\theta\\right) + m\\,r\\,{\\dot {\\theta}}^{2} - DV\\left(r\\right)&m\\,{r}^{2}\\,{\\dot {\\varphi}}^{2}\\,\\sin\\left(\\theta\\right)\\,\\cos\\left(\\theta\\right)&0\\end{bmatrix}\\\\\\begin{bmatrix}m\\,\\dot r&m\\,{r}^{2}\\,\\dot {\\theta}&m\\,{r}^{2}\\,\\dot {\\varphi}\\,{\\sin}^{2}\\left(\\theta\\right)\\end{bmatrix}\\end{pmatrix}$"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(def V (literal-function 'V))\n",
    "\n",
    "(defn T3-spherical [m]\n",
    " (compose (L-free-rectangular m) (F->C s->r)))\n",
    "\n",
    "(defn L3-central [m Vr]\n",
    "  (let [Vs (fn [[_ [r]]] (Vr r))]\n",
    "    (- (T3-spherical m) Vs)))\n",
    "\n",
    "(tex\n",
    "  (up\n",
    "    (((∂ 1) (L3-central 'm V)) spherical-state)\n",
    "    (((∂ 2) (L3-central 'm V)) spherical-state)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Show that the energy state function computed from the Lagrangian for a central field is in fact T + V."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\begin{pmatrix}\\frac{1}{2}\\,m\\,{r}^{2}\\,{\\dot {\\varphi}}^{2}\\,{\\sin}^{2}\\left(\\theta\\right) + \\frac{1}{2}\\,m\\,{r}^{2}\\,{\\dot {\\theta}}^{2} + \\frac{1}{2}\\,m\\,{\\dot r}^{2}\\\\\\frac{1}{2}\\,m\\,{r}^{2}\\,{\\dot {\\varphi}}^{2}\\,{\\sin}^{2}\\left(\\theta\\right) + \\frac{1}{2}\\,m\\,{r}^{2}\\,{\\dot {\\theta}}^{2} + \\frac{1}{2}\\,m\\,{\\dot r}^{2} + V\\left(r\\right)\\end{pmatrix}$"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(tex\n",
    "  (up  \n",
    "    ((T3-spherical 'm) (->local 't (up 'r 'θ 'φ) (up 'rdot 'θdot 'φdot)))\n",
    "    ((Lagrangian->energy (L3-central 'm V)) spherical-state)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Clojure",
   "language": "clojure",
   "name": "clojure"
  },
  "language_info": {
   "file_extension": ".clj",
   "mimetype": "text/x-clojure",
   "name": "clojure",
   "version": "1.8.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
